%I #21 Jul 11 2015 16:55:36
%S 0,0,0,0,1,0,0,0,1,0,0,1,0,1,2,0,0,0,1,0,0,1,0,1,2,0,0,1,0,1,2,0,1,2,
%T 3,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,
%U 3,4,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
%N Fourth 4-dimensional hyper-tetrahedral coordinate; 4-D analog of A056558.
%C Alternatively, write n = C(i,4)+C(j,3)+C(k,2)+C(l,1) with i>j>k>l>=0; sequence gives k values. Each n >= 0 has a unique representation as n = C(i,4)+C(j,3)+C(k,2)+C(l.1) with i>j>k>l>=0. This is the combinatorial number system of degree t = 4, where we get [A194882, A194883, A194884, A127324].
%C If {(W,X,Y,Z)} are 4-tuples of nonnegative integers with W>=X>=Y>=Z ordered by W, X, Y and Z, then W=A127321(n), X=A127322(n), Y=A127323(n) and Z=A127324(n). These sequences are the four-dimensional analogs of the three-dimensional A056556, A056557 and A056558.
%C This is a 'Matryoshka doll' sequence with alpha=0 (cf. A055462 and A000332), seq(seq(seq(seq(i,i=alpha..k),k=alpha..n),n=alpha..m),m=alpha..4). - _Peter Luschny_, Jul 14 2009
%D D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.
%H Reinhard Zumkeller, <a href="/A127324/b127324.txt">Table of n, a(n) for n = 0..10000</a>
%F For W>=X>=Y>=Z>=0, a(A000332(W+3)+A000292(X)+A000217(Y)+Z) = Z A127322(n+1) = A127321(n)==A127324(n) ? 0 : A127322(n)==A127324(n) ? 0 : A127323(n)==A127324(n) ? 0 : A127324(n)+1
%e See A127321 for a table of A127321, A127322, A127323, A127324
%e See A127327 for a table of A127324, A127325, A127326, A127327
%p seq(seq(seq(seq(i,i=0..k),k=0..n),n=0..m),m=0..5); # _Peter Luschny_, Sep 22 2011
%t Table[i, {m, 0, 5}, {k, 0, m}, {j, 0, k}, {i, 0, j}] // Flatten (* _Robert G. Wilson v_, Sep 27 2011 *)
%o (Haskell)
%o import Data.List (inits)
%o a127324 n = a127324_list !! n
%o a127324_list = concatMap (concatMap concat .
%o inits . inits . enumFromTo 0) $ enumFrom 0
%o -- _Reinhard Zumkeller_, Jun 01 2015
%Y Cf. A127321, A127322, A127323, A056556, A056557, A056558, A000332, A000292, A000217.
%Y Cf. A002262, A056558.
%K nonn
%O 0,15
%A _Graeme McRae_, Jan 10 2007