cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A171746 #24 Nov 06 2022 07:48:38
%S A171746 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,
%T A171746 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,
%U A171746 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
%N 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.
%C A171746 Iterate A028392, starting with n: a(n) is the number of steps until a square will be reached. - _Reinhard Zumkeller_, Feb 23 2012
%D A171746 Matematicko-fizicki list 1/144, problem 2-2, page 29, (1985-1986).
%H A171746 Reinhard Zumkeller, <a href="/A171746/b171746.txt">Table of n, a(n) for n = 1..10000</a>
%F A171746 From _Robert G. Wilson v_, Oct 08 2010: (Start)
%F A171746 a(k)=1 for A002061(n): n^2 - n + 1 for n>1;
%F A171746 a(k)=2 for A002522(n): n^2 + 1     for n>1;
%F A171746 a(k)=3 for A014206(n): n^2 + n + 2 for n>1;
%F A171746 a(k)=4 for A059100(n): n^2 + 2     for n>1;
%F A171746 a(k)=5 for A027688(n): n^2 + n + 3 for n>2;
%F A171746 a(k)=6 for A117950(n): n^2 + 3     for n>2;
%F A171746 a(k)=7 for A027689(n): n^2 + n + 4 for n>4;
%F A171746 a(k)=8 for A087475(n): n^2 + 4     for n>3;
%F A171746 a(k)=9 for A027690(n): n^2 + n + 5 for n>4; ... (End)
%F A171746 a(n^2) = 2*n + 1: a(A000290(n)) = A005408(n). - _Reinhard Zumkeller_, Oct 14 2010
%e A171746 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.
%t A171746 f[n_] := Length@ NestWhileList[ # + Floor@Sqrt@# &, n, ! IntegerQ@Sqrt@# || # == n &] - 1; Array[f, 93] (* _Robert G. Wilson v_, Oct 08 2010 *)
%o A171746 (Haskell)
%o A171746 a171746 = (+ 1) . length . takeWhile (== 0) .
%o A171746                            map a010052 . tail . iterate a028392
%o A171746 -- _Reinhard Zumkeller_, Feb 23 2012, Oct 14 2010
%o A171746 (PARI) f(n) = n + sqrtint(n); \\ A028392
%o A171746 a(n) = my(k=1); while (!issquare(n=f(n)), k++); k; \\ _Michel Marcus_, Nov 06 2022
%Y A171746 Cf. A010052, A028392.
%K A171746 nonn
%O A171746 1,1
%A A171746 Neven Juric (neven.juric(AT)apis-it.hr), Oct 07 2010