login
A212410
Let f(n) = n + floor(log(n)). Then a(n) is the smallest number of iterations of f on n such that the perfect square is obtained, or 0 if no such square exists.
1
1, 0, 1, 8, 7, 6, 5, 4, 11, 3, 10, 2, 9, 1, 8, 4, 7, 3, 6, 2, 5, 1, 13, 4, 8, 12, 3, 7, 11, 2, 6, 10, 1, 5, 9, 13, 4, 8, 12, 3, 7, 11, 2, 6, 10, 1, 5, 9, 35, 4, 8, 34, 3, 7, 33, 2, 6, 38, 32, 1, 5, 37, 31, 9, 4, 36, 30, 8, 3, 35, 29, 7, 2, 34, 28, 6, 1, 33, 27
OFFSET
1,4
COMMENTS
a(2) = 0 because f(f(f(….f(2)))…) = 2.
a(n)=1 for n = {1, 3, 14, 22, 33, 46, 60, 77, 96, …}
REFERENCES
T. Johnson and F. Jedrzejewski, Looking at Numbers, Springer, 2014
LINKS
EXAMPLE
a(5) = 7 because:
f(5)=6;
f(f(5))=7;
f(f(f(5)))=8;
f(f(f(f(5))))=10;
f(f(f(f(f(5)))))=12;
f(f(f(f(f(f(5))))))=14;
f(f(f(f(f(f(f(5)))))))=16.
The first square number in this sequence 6,7,8,10,12,14,16 is on the seventh place and therefore a(5)=7.
MAPLE
with(numtheory): for n from 1 to 100 do:n0:=n:i:=0:for k from 1 to 1000 while(i=0) do:n1:=n0+floor(log(n0)): n2:=sqrt(n1):if n2 = floor(n2) then printf(`%d, `, k):i:=1:else n0:=n1:fi:od:if i=0 then printf(`%d, `, 0):else fi:od:
MATHEMATICA
f[n_] := Length@NestWhileList[#+Floor[Log[#]]&, n, !IntegerQ[Sqrt[#]] || #==n&] - 1; Table[f[n], {n, 3, 100}]
CROSSREFS
Sequence in context: A090915 A194756 A132672 * A328759 A132037 A247095
KEYWORD
nonn,look
AUTHOR
Michel Lagneau, May 15 2012
STATUS
approved