Problem

Source: 17-th Iranian Mathematical Olympiad 1999/2000

Tags: function, floor function, algebra proposed, algebra



Suppose $f : \mathbb{N} \longrightarrow \mathbb{N}$ is a function that satisfies $f(1) = 1$ and $f(n + 1) =\{\begin{array}{cc} f(n)+2&\mbox{if}\ n=f(f(n)-n+1),\\f(n)+1& \mbox{Otherwise}\end {array}$ $(a)$ Prove that $f(f(n)-n+1)$ is either $n$ or $n+1$. $(b)$ Determine$f$.