login
A171746
Let f(n) = n + floor(sqrt(n)). Then a(n) is the smallest number of iterations of f on n such that a perfect square is obtained.
2
3, 2, 1, 5, 2, 4, 1, 3, 7, 2, 4, 6, 1, 3, 5, 9, 2, 4, 6, 8, 1, 3, 5, 7, 11, 2, 4, 6, 8, 10, 1, 3, 5, 7, 9, 13, 2, 4, 6, 8, 10, 12, 1, 3, 5, 7, 9, 11, 15, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 17, 2, 4, 6, 8, 10, 12, 14, 16, 1, 3, 5, 7, 9, 11, 13, 15, 19, 2, 4, 6, 8, 10, 12, 14, 16, 18, 1, 3, 5
OFFSET
1,1
COMMENTS
Iterate A028392, starting with n: a(n) is the number of steps until a square will be reached. - Reinhard Zumkeller, Feb 23 2012
REFERENCES
Matematicko-fizicki list 1/144, problem 2-2, page 29, (1985-1986).
LINKS
FORMULA
From Robert G. Wilson v, Oct 08 2010: (Start)
a(k)=1 for A002061(n): n^2 - n + 1 for n>1;
a(k)=2 for A002522(n): n^2 + 1 for n>1;
a(k)=3 for A014206(n): n^2 + n + 2 for n>1;
a(k)=4 for A059100(n): n^2 + 2 for n>1;
a(k)=5 for A027688(n): n^2 + n + 3 for n>2;
a(k)=6 for A117950(n): n^2 + 3 for n>2;
a(k)=7 for A027689(n): n^2 + n + 4 for n>4;
a(k)=8 for A087475(n): n^2 + 4 for n>3;
a(k)=9 for A027690(n): n^2 + n + 5 for n>4; ... (End)
a(n^2) = 2*n + 1: a(A000290(n)) = A005408(n). - Reinhard Zumkeller, Oct 14 2010
EXAMPLE
f(9)=12, f(12)=15, f(15)=18, f(18)=22, f(22)=26, f(26)=31, f(31)=36. The first square number in this sequence 12,15,18,22,26,31,36 is on the seventh place and therefore a(9)=7.
MATHEMATICA
f[n_] := Length@ NestWhileList[ # + Floor@Sqrt@# &, n, ! IntegerQ@Sqrt@# || # == n &] - 1; Array[f, 93] (* Robert G. Wilson v, Oct 08 2010 *)
PROG
(Haskell)
a171746 = (+ 1) . length . takeWhile (== 0) .
map a010052 . tail . iterate a028392
-- Reinhard Zumkeller, Feb 23 2012, Oct 14 2010
(PARI) f(n) = n + sqrtint(n); \\ A028392
a(n) = my(k=1); while (!issquare(n=f(n)), k++); k; \\ Michel Marcus, Nov 06 2022
CROSSREFS
Sequence in context: A030313 A300219 A278817 * A113977 A183162 A309219
KEYWORD
nonn
AUTHOR
Neven Juric (neven.juric(AT)apis-it.hr), Oct 07 2010
STATUS
approved