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 A386369 #13 Jul 30 2025 09:47:52 %S A386369 0,1,2,2,2,2,6,6,6,6,6,6,6,6,6,6,6,6,18,18,18,18,18,18,18,18,26,26,26, %T A386369 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, %U A386369 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26 %N A386369 a(1) = 0, and for any n > 1, a(n) is the largest k < n such that a(1) + ... + a(k) is a square number. %C A386369 In other words: a(1) = 0, and for any n > 0, if a(1) + ... + a(n) is a square number then a(n+1) = n, otherwise a(n+1) = a(n). %C A386369 This sequence is unbounded: if a(1) + ... + a(n) = u^2, then a(n+1) = n, u^2 + n * (2*u+n) = (u+n)^2, so a(1) + ... + a(m) is a square number for some m > n, and a(m+1) = m > a(n+1). %H A386369 Rémy Sigrist, <a href="/A386369/b386369.txt">Table of n, a(n) for n = 1..10000</a> %e A386369 Sequence begins: %e A386369 n a(n) a(1)+...+a(n) Square? %e A386369 -- ---- ------------- ------- %e A386369 1 0 0 Yes %e A386369 2 1 1 Yes %e A386369 3 2 3 No %e A386369 4 2 5 No %e A386369 5 2 7 No %e A386369 6 2 9 Yes %e A386369 7 6 15 No %e A386369 8 6 21 No %e A386369 9 6 27 No %e A386369 10 6 33 No %t A386369 Module[{s = 0,a = 0}, Table[If[IntegerQ[Sqrt[s += a]], a = n-1]; a, {n, 100}]] (* _Paolo Xausa_, Jul 29 2025, after _Rémy Sigrist_ *) %o A386369 (PARI) { t = 0; v = 0; for (n = 1, 70, print1 (v", "); t += v; if (issquare(t), v = n;);); } %Y A386369 See A385986 for a similar sequence. %Y A386369 Cf. A385254, A386370, A386687, A386688. %K A386369 nonn %O A386369 1,3 %A A386369 _Rémy Sigrist_, Jul 19 2025