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 A253902 #26 Feb 28 2025 23:11:30 %S A253902 1,4,3,2,1,9,8,7,6,5,4,3,2,1,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1, %T A253902 25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,36, %U A253902 35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1 %N A253902 Write numbers 1, then 2^2 down to 1, then 3^2 down to 1, then 4^2 down to 1 and so on. %C A253902 Triangle read by rows in which row n lists the first n^2 positive integers in decreasing order, n >= 1. - _Omar E. Pol_, Jan 20 2015 %F A253902 For 1 <= n <= 650, a(n) = -n + (t + 2)*(2*t^2 - t + 3)/6, where t = floor((3*n)^(1/3)+1/2). %F A253902 a(n) = k*(2*k^2-9*k+13)/6-n where k = floor((3*n)^(1/3))+3 if n>A000330(floor((3*n)^(1/3))) and k = floor((3*n)^(1/3))+2 otherwise. - _Chai Wah Wu_, Nov 05 2024 %e A253902 From _Omar E. Pol_, Jan 20 2015: (Start) %e A253902 Written as an irregular triangle in which row lengths are successive squares, the sequence begins: %e A253902 1; %e A253902 4, 3, 2, 1; %e A253902 9, 8, 7, 6, 5, 4, 3, 2, 1; %e A253902 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1; %e A253902 ... %e A253902 (End) %p A253902 T:= n-> (t-> seq(t-i, i=0..t-1))(n^2): %p A253902 seq(T(n), n=1..6); # _Alois P. Heinz_, Nov 05 2024 %t A253902 a253902[n_] := Flatten@ Table[Reverse[Range[i^2]], {i, n}]; a253902[6] (* _Michael De Vlieger_, Jan 19 2015 *) %o A253902 (PARI) lista(nn=10) = {for (n=1, nn, forstep(k=n^2, 1, -1, print1(k, ", ");););} \\ _Michel Marcus_, Jan 20 2015 %o A253902 (Python) %o A253902 from sympy import integer_nthroot %o A253902 def A253902(n): return (k:=(m:=integer_nthroot(3*n,3)[0])+(6*n>m*(m+1)*((m<<1)+1))+2)*(k*((k<<1)-9)+13)//6-n # _Chai Wah Wu_, Nov 05 2024 %Y A253902 Cf. A000290, A064866, A074279. %K A253902 nonn,easy,tabf %O A253902 1,2 %A A253902 _Mikael Aaltonen_, Jan 18 2015