OFFSET
1,3
COMMENTS
It is conjectured that this algorithm will always terminate at 1 or 11.
Matthijs Coster verified the conjecture for n <= 100000.
Neil Fernandez checked for n <= 2*10^6 and always reached either the cycle (1,5,14,7,16,8,4,2,1) or the cycle (11,27,63,127,271,560,280,140,70,35,71,152,76,38,19,44,22,11).
Jim Nastos verified the conjecture for n <= 43*10^6 (Oct 21 2019).
Generalization: The algorithm also appears to terminate 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.
EXAMPLE
The trajectory of 22 reaches 11 in a single iteration, so a(22) = 1. - Jon E. Schoenfield, Oct 20 2019
The trajectory of 9 is [9, 25, 61, 125, 269, 558, 279, 568, 284, 142, 71, 152, 76, 38, 19, 44, 22, 11], taking 17 steps to reach 11. So a(9) = 17. - N. J. A. Sloane, Oct 20 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Ali Sada, Oct 20 2019
EXTENSIONS
Edited and data corrected by Jon E. Schoenfield and N. J. A. Sloane, Oct 20 2019
STATUS
approved