Function $f$ is defined on the positive integers by $f(1)=1$, $f(2)=2$ and $$f(n+2)=f(n+2-f(n+1))+f(n+1-f(n))\enspace\text{for }n\ge1.$$(a) Prove that $f(n+1)-f(n)\in\{0,1\}$ for each $n\ge1$. (b) Show that if $f(n)$ is odd then $f(n+1)=f(n)+1$. (c) For each positive integer $k$ find all $n$ for which $f(n)=2^{k-1}+1$.
Problem
Source: Croatia 1997 Grade 4 P3
Tags: fe, number theory, algebra, functional equation, Functional Equations