OFFSET
1,2
COMMENTS
Let n=n(i,j,k) be the position of (i,j,k) in the lexicographic ordering A057557 of N X N X N, where N={1,2,3,...}. Row h of A186004 lists those n for which j=n, the distance from (i,j,k) to the xz-plane. Every positive integer occurs exactly once in the array, so that as a sequence, A186004 is a permutation of the positive integers.
LINKS
G. C. Greubel, Table of n, a(n) for the first 50 rows, flattened
EXAMPLE
Northwest corner:
1, 2, 4, 5, 8, 10
3, 6, 9, 12, 16, 19
7, 13, 17, 23, 28, 32
14, 24, 29, 39, 45, 50
25, 40, 46, 61, 68, 74
T(2,2)=6, the position of (1,2,2) in the ordering
(1,1,1) < (1,1,2) < (1,2,1) < (2,1,1) < (1,1,3) < (1,2,2) < (1,3,1) < ...
MATHEMATICA
lexicographicLattice[{dim_, maxHeight_}]:=Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1, {dim}], 1]&, maxHeight], 1];
lexicographicLatticeHeightArray[{dim_, maxHeight_, axis_}]:=Array[Flatten@Position[Map[#[[axis]]&, lexicographicLattice[{dim, maxHeight}]], #]&, maxHeight];
llha=lexicographicLatticeHeightArray[{3, 12, 2}];
ordering=lexicographicLattice[{2, Length[llha]}];
llha[[#1, #2]]&@@#1&/@ordering
(* Peter J. C. Moses, Feb 15 2011 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Clark Kimberling, Feb 10 2011
STATUS
approved