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 A056558 #32 Nov 05 2024 12:17:13 %S A056558 0,0,0,1,0,0,1,0,1,2,0,0,1,0,1,2,0,1,2,3,0,0,1,0,1,2,0,1,2,3,0,1,2,3, %T A056558 4,0,0,1,0,1,2,0,1,2,3,0,1,2,3,4,0,1,2,3,4,5,0,0,1,0,1,2,0,1,2,3,0,1, %U A056558 2,3,4,0,1,2,3,4,5,0,1,2,3,4,5,6,0,0,1,0,1,2,0,1,2,3,0,1,2,3,4,0,1,2,3,4,5 %N A056558 Third tetrahedral coordinate, i.e., tetrahedron with T(t,n,k)=k; succession of growing finite triangles with increasing values towards bottom right. %C A056558 Alternatively, write n = C(i,3)+C(j,2)+C(k,1) with i>j>k>=0; sequence gives k values. See A194847 for further information about this interpretation. %C A056558 If {(X,Y,Z)} are triples of nonnegative integers with X>=Y>=Z ordered by X, Y and Z, then X=A056556(n), Y=A056557(n) and Z=A056558(n). %C A056558 This is a 'Matryoshka doll' sequence with alpha=0 (cf. A000292 and A000178). - _Peter Luschny_, Jul 14 2009 %D A056558 D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360. %H A056558 Reinhard Zumkeller, <a href="/A056558/b056558.txt">Table of n, a(n) for n = 0..10000</a> %F A056558 a(n) = n-A056556(n)*(A056556(n)+1)*(A056556(n)+2)/6-A056557(n)*(A056557(n)+1)/2 = n-A000292(A056556(n)-1)-A000217(A056557(n)) = A056557(n)-A056560(n). %F A056558 a(n+1) = A056556(n)==a(n) ? 0 : A056557(n)==a(n) ? 0 : a(n)+1. - _Graeme McRae_, Jan 09 2007 %e A056558 First triangle: [0]; second triangle: [0; 0 1]; third triangle: [0; 0 1; 0 1 2]; ... %p A056558 seq(seq(seq(i,i=0..k),k=0..n),n=0..6); # _Peter Luschny_, Sep 22 2011 %t A056558 Table[i, {k, 0, 7}, {j, 0, k}, {i, 0, j}] // Flatten (* _Robert G. Wilson v_, Sep 27 2011 *) %o A056558 (Haskell) %o A056558 import Data.List (inits) %o A056558 a056558 n = a056558_list !! n %o A056558 a056558_list = concatMap (concat . init . inits . enumFromTo 0) [0..] %o A056558 -- _Reinhard Zumkeller_, Jun 01 2015 %o A056558 (PARI) T(t,n,k)=k \\ _Charles R Greathouse IV_, Feb 22 2017 %o A056558 (Python) %o A056558 from math import isqrt, comb %o A056558 from sympy import integer_nthroot %o A056558 def A056558(n): return (r:=n-comb((m:=integer_nthroot(6*(n+1),3)[0])+(n>=comb(m+2,3))+1,3))-comb((k:=isqrt(m:=r+1<<1))+(m>k*(k+1)),2) # _Chai Wah Wu_, Nov 04 2024 %Y A056558 Together with A056559 and A056560 might enable reading "by antidiagonals" of cube arrays as 3-dimensional analog of A002262 and A025581 with square arrays. Also cf. A000292, A056556, A056557. %Y A056558 See also A194847, A194848, A194849. %Y A056558 Cf. A002262, A127324, A000217. %K A056558 nonn %O A056558 0,10 %A A056558 _Henry Bottomley_, Jun 26 2000