OFFSET
1,3
COMMENTS
Let RL denote reverse lexicographic. Write each partition p of n in RL order, and then arrange all the partitions of n in RL order, obtaining a list L as in Mathematica's IntegerPartitions[n]. Let L' be the reversal of L. Let p(i) be the i-th partition in L and let p'(i) be the i-th in L'; then p'(i) is introduced here as the contraconjugate of p(i) . (Note that RL order could be called "greedy" order, because the result of applying the greedy algorithm to p is the same as for RL, and likewise for arranging the partitions in RL order. For a discussion of various orderings, see A080577.)
EXAMPLE
First 14 rows:
1
0 2
1 0 2
1 2 0 2
1 2 2 0 2
1 0 6 2 0 2
1 2 2 6 2 0 2
0 6 2 4 6 2 0 2
0 2 4 8 6 6 2 0 2
0 4 8 8 8 4 6 2 0 2
0 6 10 8 12 6 4 6 2 0 2
1 4 14 8 16 10 6 6 8 2 0 2
1 4 18 10 14 20 10 6 6 8 2 0 2
1 8 8 18 20 22 16 16 6 8 8 2 0 2
The list L for the partitions of 5 is:
[5], [4,1], [3,2], [3,1,1], [2,2,1], [2,1,1,1], [1,1,1,1,1].
The list L' of contraconjugates p' and distances d(p,p') are given by:
p = [5]; p' = [1,1,1,1,1]; d(p,p') = 8
p = [4,1]; p' = [2,1,1,1]; d(p,p') = 4
p = [3,2]; p' = [2,2,1]; d(p,p') = 2
p = [3,1,1,1]; p' = [3,1,1,1]; d(p,p') = 0
p = [2,2,1]; p' = [3,2]; d(p,p') = 2
p = [2,1,1,1]; p' = [4,1]; d(p,p') = 4
p = [1,1,1,1,1], p' = [5]; d(p,p') = 8;
so that the numbers of 0s, 2s, 4s, 6s, 8s are 1, 2, 2, 0, 2, as in row 5.
MATHEMATICA
c[n_] := PartitionsP[n];
p[n_, k_] := p[n, k] = IntegerPartitions[n][[k]];
r[n_, k_] := r[n, k] = Join[p[n, k], ConstantArray[0, n - Length[p[n, k]]]];
p1[n_, k_] := p1[n, k] = Reverse[IntegerPartitions[n]][[k]];
r1[n_, k_] := r1[n, k] = Join[p1[n, k], ConstantArray[0, n - Length[p1[n, k]]]];
d[u_, v_] := Total[Abs[u - v]];
t[n_] := Flatten[Table[d[r[n, k], r1[n, k]], {k, 1, c[n]}]];
t1 = Table[Count[t[n], m], {n, 1, 16}, {m, 0, 2 n - 1, 2}]
TableForm[t1] (* array *)
u = Flatten[t1] (*sequence *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Clark Kimberling, Oct 25 2023
STATUS
approved