login
a(n) = number of iterations of f(x)=floor((x^2+n)/(2x)) starting at x=n to reach the value floor(sqrt(n)) (=A000196(n)).
4

%I #8 Aug 12 2019 23:26:25

%S 0,1,2,1,2,2,2,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3,3,3,3,3,3,4,4,4,

%T 4,3,3,3,3,4,4,4,4,4,4,4,4,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,4,4,4,4,4,

%U 4,4,4,4,4,4,4,4,5,5,5,5,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,4

%N a(n) = number of iterations of f(x)=floor((x^2+n)/(2x)) starting at x=n to reach the value floor(sqrt(n)) (=A000196(n)).

%C Also, we have f(x) = floor((x + floor(n/x))/2).

%C Notice that f(n) = f(1) = floor((n+1)/2), and so the starting value x = 1 gives the same sequence.

%C 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)).

%o (PARI) { A327007(n,a=n) = my(k = 0); while(1, my(b = (a+n\a)\2); if(b >= a,break); a = b; k++); k; }

%Y Cf. A000196, A327008, A327009, A327010.

%K nonn

%O 1,3

%A _Max Alekseyev_, Aug 12 2019