# Find the sum of all values of $f(2017)$ given $f^{f(a)}(b) f^{f(b)} (a) = [f(a+b)]^2$.

Let $f:\mathbb N\rightarrow \mathbb N$ be an injective function such that $$f^{f(a)}(b) f^{f(b)} (a) = [f(a+b)]^2$$ for all $a,b \in \mathbb N$. Let $S$ be the sum of all possible values of $f(2017)$. Find $S$ (mod $1000$).

Write

$$f^{k}(n) =f(f(f(\cdots k \text{ times }\cdots f(n)))\cdots).$$

So I put $a=b$ and found out that $f^{f(a)}(a) = f(2a)$.

Since $f$ is injective $f^{f(a)-1}(a)=2a$. I found out that $f(1)=2$.

Now $f(2)=3$ by putting value of $a=1$ in initial equation and solving for $f(b)=3$. It seems by guessing that $f(n)=n+1$ but can't the function be periodic after certain interval and is unbounded and repeat its value? It can still be injective.

Any help here to clarify this doubt?

An injective function 'cannot repeat its value' - if $$f$$ is injective, then if $$f(a)=f(b)$$, it must be the case that $$a=b$$. Because the problem condition tells you that $$f$$ is injective, it follows that it is not periodic.