# Weird Functional Equation

Algebra Level 4

$f^{f(a)}(b) f^{f(b)}(a) = \big(f(a+b)\big)^2$

Let $$f:\mathbb{N} \to \mathbb{N}$$ be an injective function such that the above holds true for all $$a,b \in \mathbb{N}$$. Let $$S$$ be the sum of all possible values of $$f(2017)$$. Find $$S \bmod{1000}$$.


Note: $$f^{k} (n)$$ means $$\underbrace{f\big(f(f(\ldots f(n)\ldots))\big)}_{\text{number of }f \text{'s}\ = \ k}.$$

×