Problem
ALG-B3-M08-P013 Iteration and Shift on Integers
#13
★★★★☆ Level 4 of 5
Let \(f:\mathbb Z\to\mathbb Z\), \(f(n+1)=f(n)+1\), and \(f^2(n)=n+4\). Find \(f(n)\).
From the first condition, \(f(n)=n+c\).
From \(f(n+1)=f(n)+1\), the value \(f(n)-n\) is constant on \(\mathbb Z\). Hence \(f(n)=n+c\). Then \(f^2(n)=n+2c\). The condition gives \(2c=4\), so \(c=2\). The answer is \(f(n)=n+2\).
Discrete iteration with a recurrence.