OFFSET
1,3
COMMENTS
Also, we have f(x) = floor((x + floor(n/x))/2).
Notice that f(n) = f(1) = floor((n+1)/2), and so the starting value x = 1 gives the same sequence.
Iterations f(f(...f(a))...) reach floor(sqrt(n)) for any starting integer a >= 1. They either stabilize to floor(sqrt(n)) or alternate between floor(sqrt(n)) and ceiling(sqrt(n)).
PROG
(PARI) { A327007(n, a=n) = my(k = 0); while(1, my(b = (a+n\a)\2); if(b >= a, break); a = b; k++); k; }
CROSSREFS
KEYWORD
nonn
AUTHOR
Max Alekseyev, Aug 12 2019
STATUS
approved