%I #16 Jul 25 2017 02:28:34
%S 1,2,3,4,6,7,5,9,13,14,8,12,17,24,25,10,16,23,29,40,41,11,19,28,39,46,
%T 62,63,15,22,32,45,61,69,91,92,18,27,38,50,68,90,99,128,129,20,31,44,
%U 60,74,98,127,137,174,175,21,34,49,67,89,105,136,173,184,230,231,26,37,53,73,97,126,144,183,229,241,297,298
%N Distance array associated with ordering A057557 of N X N X N, by antidiagonals (distances to xz plane).
%C 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.
%H G. C. Greubel, <a href="/A186004/b186004.txt">Table of n, a(n) for the first 50 rows, flattened</a>
%e Northwest corner:
%e 1, 2, 4, 5, 8, 10
%e 3, 6, 9, 12, 16, 19
%e 7, 13, 17, 23, 28, 32
%e 14, 24, 29, 39, 45, 50
%e 25, 40, 46, 61, 68, 74
%e T(2,2)=6, the position of (1,2,2) in the ordering
%e (1,1,1) < (1,1,2) < (1,2,1) < (2,1,1) < (1,1,3) < (1,2,2) < (1,3,1) < ...
%t lexicographicLattice[{dim_,maxHeight_}]:=Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1,{dim}],1]&,maxHeight],1];
%t lexicographicLatticeHeightArray[{dim_,maxHeight_,axis_}]:=Array[Flatten@Position[Map[#[[axis]]&,lexicographicLattice[{dim,maxHeight}]],#]&,maxHeight];
%t llha=lexicographicLatticeHeightArray[{3,12,2}];
%t ordering=lexicographicLattice[{2,Length[llha]}];
%t llha[[#1,#2]]&@@#1&/@ordering
%t (* _Peter J. C. Moses_, Feb 15 2011 *)
%Y Cf. A057557, A186003, A186005.
%K nonn,tabl
%O 1,2
%A _Clark Kimberling_, Feb 10 2011