A056558 Third tetrahedral coordinate, i.e., tetrahedron with T(t,n,k)=k; succession of growing finite triangles with increasing values towards bottom right.
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, 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, 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
Offset: 0
Keywords
Examples
First triangle: [0]; second triangle: [0; 0 1]; third triangle: [0; 0 1; 0 1 2]; ...
References
- D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Crossrefs
Programs
-
Haskell
import Data.List (inits) a056558 n = a056558_list !! n a056558_list = concatMap (concat . init . inits . enumFromTo 0) [0..] -- Reinhard Zumkeller, Jun 01 2015
-
Maple
seq(seq(seq(i,i=0..k),k=0..n),n=0..6); # Peter Luschny, Sep 22 2011
-
Mathematica
Table[i, {k, 0, 7}, {j, 0, k}, {i, 0, j}] // Flatten (* Robert G. Wilson v, Sep 27 2011 *)
-
PARI
T(t,n,k)=k \\ Charles R Greathouse IV, Feb 22 2017
-
Python
from math import isqrt, comb from sympy import integer_nthroot 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
Comments