A186003 Distance array associated with ordering A057557 of N X N X N, by antidiagonals (distances to yz plane).
1, 2, 4, 3, 8, 10, 5, 9, 18, 20, 6, 15, 19, 33, 35, 7, 16, 30, 34, 54, 56, 11, 17, 31, 51, 55, 82, 84, 12, 26, 32, 52, 79, 83, 118, 120, 13, 27, 47, 53, 80, 115, 119, 163, 165, 14, 28, 48, 75, 81, 116, 160, 164, 218, 220, 21, 29, 49, 76, 111, 117, 161, 215, 219, 284, 286, 22, 42, 50, 77, 112, 156, 162, 216, 281, 285, 362, 364
Offset: 1
Examples
Northwest corner: 1, 2, 3, 5, 6, 7, 11 4, 8, 9, 15, 16, 17, 26 10, 18, 19, 30, 31, 32, 47 20, 33, 34, 51, 52, 53, 75 35, 54, 55, 79, 80, 81, 111 T(2,1)=4, the position of (2,1,1) in the ordering (1,1,1) < (1,1,2) < (1,2,1) < (2,1,1) < (1,1,3) < (1,2,2) < (1,3,1) < ...
Links
- G. C. Greubel, Table of n, a(n) for the first 50 rows, flattened
Programs
-
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,1}]; ordering=lexicographicLattice[{2,Length[llha]}]; llha[[#1,#2]]&@@#1&/@ordering (* Peter J. C. Moses, Feb 15 2011 *)
Comments