login
Number of iterations of A049820(x) = x - A000005(x) needed to reach a square, when starting from x = n.
3

%I #17 Jan 07 2019 11:12:50

%S 0,0,1,1,0,2,2,3,1,0,3,1,3,2,4,2,0,3,4,4,5,4,5,5,1,0,6,6,6,7,6,8,7,8,

%T 7,9,0,10,8,10,8,11,8,12,9,11,9,12,9,0,10,13,10,14,10,14,10,15,11,16,

%U 10,17,12,16,0,18,12,19,13,19,13,20,11,21,14,20,14,22,14,23,14,0,15,1,12,1,16,2,15,3,15,3,17,4,16,4,13,5,18,5,0

%N Number of iterations of A049820(x) = x - A000005(x) needed to reach a square, when starting from x = n.

%H Antti Karttunen, <a href="/A322987/b322987.txt">Table of n, a(n) for n = 0..16384</a>

%H Antti Karttunen, <a href="/A322987/a322987.txt">Data supplement: n, a(n) computed for n = 1..110880</a>

%F If A010052(n) == 1 [when n is in A000290], then a(n) = 0, otherwise a(n) = 1+a(A049820(n)).

%F a(n) <= A155043(n).

%F For n >= 83, a(2*n) = A322996(2*n)-1. [Note that 2*83 = 166 > 144 = A262514(2).]

%o (PARI) A322987(n) = if(issquare(n),0,1+A322987(n-numdiv(n)));

%o (PARI) A322987(n) = { for(j=0,oo,if(issquare(n),return(j)); n -= numdiv(n)); };

%Y Cf. A000290, A010052, A049820, A155043, A259934, A262514, A262680, A322996, A323073.

%K nonn

%O 0,6

%A _Antti Karttunen_, Jan 05 2019