Let $f(n) = n+\lfloor \sqrt{n}\rfloor$. Prove that for every positive integer $a$, the sequence $a, f(a),\cdots$ contains at least one square of an integer.
Can someone explain why in the solution below, $f^r(m)$ is a square for some r with $0\leq r\leq 2j$? Why is it $2j$ instead of $j$? From my understanding, the "excess" strictly decreases by 1 provided it's positive.

Any natural number can be placeb between two consecutive perfect squares. Precisely, for any $m\in\Bbb N$ there is $k\in\Bbb N$ such that $k^2\leq m<(k+1)^2=k^2+2k+1$. Therefore each natural $m$ can be presented as $k^2+j$ where $0\leq j\leq 2k$. For example
Now, all numbers are divided into two sets: $$A=\{k^2+j:0\leq j\leq k\}\quad\text{and}\quad B=\{k^2+j:k< j\leq 2k\}.$$
It is shown that
Example Let $m=46\in B$ ($k=6,\ j=10$). Then:
Now let's check the condition $0\leq r\leq 2j$. Let $E(a)$ be the excess of $a$. Choose any $m$ and put $E(m)=j$.