Here's the question:
For nonnegative integer $n$, the following are true: $$ \text{(a) } f(0) = 0$$ $$ \text{(b) } f(1) = 1$$ $$ \text{(c) } f(n) = f(n - \frac{m(m - 1)}{2}) - f(\frac{m(m + 1) }{2} - n)$$ for integer $m$ satisfying $m \ge 2$ and $\frac{m(m - 1)}{2} < n \leq \frac{m(m + 1)}{2}$. Find the smallest $n$ such that $f(n) = 4$. (PUMaC 2014 Algebra #8)
In the official solution, they begin:
Computing small values, we see $f(2) = 0$, $f(3) = 0$, $f(4) = 1$, and $f(5) = -1$. The fastest way to find $k$ such that $f(k) = 2$ is $2 = 1 - (-1) = f(1) - f(5) = f(16 - 1) + f(21 - 16) = f(16). ...$
And then they find the value of $k$ where $f(k) = -2$ and $f(k) = 4$ similarly.
I'm just a bit confused on how they jumped from $f(1) - f(5)$ to $f(16 - 1) + f(21 - 16)$, then to $f(16)$. Could someone please explain, or give an alternative solution?
Their $$f(1) - f(5) = f(16 - 1)\color{red}+ f(21 - 16)$$ is clearly wrong (the LHS is equal to $2,$ whereas the RHS is equal to $-2$). They probably intended to write $$f(1) - f(5) = f(16 - 1\color{red}5)\color{red}-f(21 - 16),$$ which they may have found the following way: $$\frac{m(m+1)}2-\frac{m(m-1)}2=5-1\iff m=6$$ $$\implies\frac{m(m+1)}2=21,\quad\frac{m(m-1)}2=15.$$ And by definition, $$f(16)=f(16-15)-f(21-16).$$