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 A064865 #20 Nov 05 2024 11:55:37 %S A064865 1,2,1,5,1,7,14,6,15,25,11,23,36,14,29,45,13,31,50,6,27,49,72,15,40, %T A064865 66,93,21,50,80,111,22,55,89,124,16,53,91,130,1,42,84,127,171,20,66, %U A064865 113,161,210,35,86,138,191,245,44,100,157,215,274,45,106,168,231,295,36 %N A064865 Fill a triangular array by rows by writing numbers 1, then 1 up to 2^2, then 1 up to 3^2, then 1 up to 4^2 and so on. The final elements of the rows form the sequence. %C A064865 Does every number appear at least once? Do some numbers like 1 appear infinitely often? - _Robert G. Wilson v_, Oct 10 2001 %C A064865 Difference between n-th triangular number and largest square pyramidal number (A000330) less than it. - _Franklin T. Adams-Watters_, Sep 11 2006 %H A064865 Alois P. Heinz, <a href="/A064865/b064865.txt">Table of n, a(n) for n = 1..10000</a> %F A064865 a(n) = n(n+1)/2 - max_{p(m) < n(n+1)/2} p(m), where p(m) = m(m+1)(2m+1)/6. - _Franklin T. Adams-Watters_, Sep 11 2006 %e A064865 The triangle begins: %e A064865 ....1 %e A064865 ...1.2 %e A064865 ..3.4.1 %e A064865 .2.3.4.5 %e A064865 6.7.8.9.1 %t A064865 a = {}; Do[a = Append[a, Table[i, {i, 1, n^2} ]], {n, 1, 100} ]; a = Flatten[a]; Do[Print[a[[n(n + 1)/2]]], {n, 1, 100} ] %t A064865 With[{nn=20},TakeList[Flatten[Table[Range[n^2],{n,nn}]],Range[Floor[ (Sqrt[8*nn^3+12*nn^2+4*nn+3]/Sqrt[3]-1)/2]]]][[All,-1]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Dec 04 2020 *) %o A064865 (Python) %o A064865 from sympy import integer_nthroot %o A064865 def A064865(n): return 1+(k:=(n*(n+1)>>1)-1)-(r:=(m:=integer_nthroot(3*k, 3)[0])-(6*k<m*(m+1)*((m<<1)+1)))*(r+1)*((r<<1)+1)//6 # _Chai Wah Wu_, Nov 05 2024 %Y A064865 Table: A064866. %Y A064865 Mini-index to these sequences: A064766, A064865, A064866, A065221-A655234 are all of the same type. See A064766 for a detailed explanation. %Y A064865 Cf. A000217, A000330. %K A064865 nonn,look,easy %O A064865 1,2 %A A064865 _Floor van Lamoen_, Oct 08 2001 %E A064865 More terms from _Robert G. Wilson v_, Oct 10 2001