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.
%I A326823 #53 May 11 2025 11:30:39 %S A326823 0,1,6,2,7,7,5,3,17,8,0,8,21,6,21,4,15,18,3,9,13,1,11,9,16,22,16,7,20, %T A326823 22,20,5,10,16,8,19,16,4,4,10,16,14,14,2,14,12,12,10,31,17,38,23,29, %U A326823 17,27,8,34,21,34,23,15,21,15,6,19,11,19,17,9,9,7 %N A326823 a(n) is the number of iterations needed to reach 1 or 11 starting at n and using the map k -> (k/2 if k is even, otherwise k + (smallest square > k)). Set a(n) = -1 if the trajectory never reaches 1 or 11. %C A326823 It is conjectured that this algorithm will always terminate at 1 or 11. %C A326823 _Matthijs Coster_ verified the conjecture for n <= 100000. %C A326823 _Neil Fernandez_ checked for n <= 2*10^6 and always reached either the cycle (1,5,14,7,16,8,4,2,1) or the cycle (11,27,63,127,271,560,280,140,70,35,71,152,76,38,19,44,22,11). %C A326823 _Jim Nastos_ verified the conjecture for n <= 43*10^6 (Oct 21 2019). %C A326823 Generalization: The algorithm also appears to terminate when replacing the least perfect square greater than n with the greatest perfect square less than n. It also seems to terminate when square is replaced by any power. %H A326823 M. F. Hasler, <a href="/A326823/b326823.txt">Table of n, a(n) for n = 1..1000</a>, May 08 2025 %e A326823 The trajectory of 3 is 3 -> 3+4 = 7 -> 7+9 = 16 -> 8 -> 4 -> 2 -> 1, taking a(3) = 6 steps to reach 1. - _M. F. Hasler_, May 08 2025 %e A326823 The trajectory of 9 is [9, 25, 61, 125, 269, 558, 279, 568, 284, 142, 71, 152, 76, 38, 19, 44, 22, 11], taking 17 steps to reach 11. So a(9) = 17. - _N. J. A. Sloane_, Oct 20 2019 %e A326823 The trajectory of 22 reaches 11 in a single iteration, so a(22) = 1. - _Jon E. Schoenfield_, Oct 20 2019 %o A326823 (PARI) M326823=Map([1,0;11,0]); A326823(n)=if(mapisdefined(M326823, n, &n), n, mapput(M326823, n, 1+n=A326823(if(n%2, n+(sqrtint(n)+1)^2, n\2))); 1+n) \\ _M. F. Hasler_, May 08 2025 %Y A326823 Cf. A006577, A326825. %K A326823 nonn %O A326823 1,3 %A A326823 _Ali Sada_, Oct 20 2019 %E A326823 Edited and data corrected by _Jon E. Schoenfield_ and _N. J. A. Sloane_, Oct 20 2019