Consider the following algorithm:
pick an integer $n> 0$.
If $n$ is even, divide by 2. If $n$ is odd, find the least perfect square $m^2$ greater then $n$ and add $m^2$+n.
Repeat step 2. with either $n/2$ or $n + m^2$.
The conjecture is this algorithm will always terminate at a 1 or an 11. To show it terminates can be done by induction. Why do 1 and 11 appear? Is there anything significant about the number of "termination points" (here, just 1 and 11, so 2 termination points.)?
Generalization: The algorithm seems to terminate for all $n$ when replacing the least perfect square greater than n with the greatest perfect square less than n. It also seems to terminate when square is replaced by any power.
How can I understand this algorithm and its variations better, and in particular, the numbers where it terminates?
The calculations were done by Dr. Matthijs Coster found it was true for 100,000 numbers; and Neil Fernandez reached 1.2*10^6 .