OFFSET
0,3
COMMENTS
The canonical ordering of partitions is described in A080577.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..130
Wikipedia, Integer Partition
EXAMPLE
a(3) = 9, because 531 has position 9 within the list of partitions of 3*3 in canonical ordering: 9, 81, 72, 711, 63, 621, 6111, 54, 531, ... .
MAPLE
b:= proc(n, i) option remember;
`if`(n=0, 1, b(n-i, i-2)+g(n, i-1))
end:
g:= proc(n, i) option remember; `if`(n=0 or i=1, 1,
`if`(i<1, 0, g(n-i, min(n-i, i))+g(n, i-1)))
end:
a:= n-> g(n^2$2)-b(n^2, 2*n-1)+1:
seq(a(n), n=0..23);
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, 1, b[n - i, i - 2] + g[n, i - 1]];
g[n_, i_] := g[n, i] = If[n == 0 || i == 1, 1, If[i < 1, 0, g[n - i, Min[n - i, i]] + g[n, i - 1]]];
a[n_] := g[n^2, n^2] - b[n^2, 2n - 1] + 1;
a /@ Range[0, 23] (* Jean-François Alcover, May 10 2020, after Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 20 2020
STATUS
approved