Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A057554
Lexicographic ordering of MxM, where M={0,1,2,...}.
4
0, 0, 0, 1, 1, 0, 0, 2, 1, 1, 2, 0, 0, 3, 1, 2, 2, 1, 3, 0, 0, 4, 1, 3, 2, 2, 3, 1, 4, 0, 0, 5, 1, 4, 2, 3, 3, 2, 4, 1, 5, 0, 0, 6, 1, 5, 2, 4, 3, 3, 4, 2, 5, 1, 6, 0, 0, 7, 1, 6, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 7, 0, 0, 8, 1, 7, 2, 6, 3, 5, 4, 4, 5, 3, 6, 2, 7, 1, 8, 0, 0, 9, 1, 8, 2, 7, 3, 6, 4, 5, 5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 0, 10, 1, 9, 2, 8, 3, 7, 4, 6, 5, 5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 0, 0, 11, 1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0
OFFSET
1,8
COMMENTS
A057555 gives the lexicographic ordering of N x N, where N={1,2,3,...}.
LINKS
EXAMPLE
Flatten the ordered lattice points: (0,0) < (0,1) < (1,0) < (0,2) < (1,1) < ... as 0,0, 0,1, 1,0, 0,2, 1,1, ...
MATHEMATICA
lexicographicLattice[{dim_, maxHeight_}]:= Flatten[Array[Sort@Flatten[(Permutations[#1]&)/@IntegerPartitions[#1+dim-1, {dim}], 1]&, maxHeight], 1]; Flatten@lexicographicLattice[{2, 12}]-1 (* Peter J. C. Moses, Feb 10 2011 *)
PROG
(Python)
[l for i in range(20) for k in range(i, -1, -1) for l in (i-k, k)] # Nicholas Stefan Georgescu, Oct 10 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Sep 07 2000
STATUS
approved