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..4000
Wikipedia, Integer Partition
FORMULA
a(n) ~ exp(Pi*sqrt(2*n)) / (4*3^(3/2)*n). - Vaclav Kotesovec, Feb 28 2020
EXAMPLE
a(2) = 5, because 33 has position 5 within the list of partitions of 6 in canonical ordering: 6, 51, 42, 411, 33, 321, 3111, 222, ... .
MAPLE
b:= proc(n) option remember;
`if`(n=0, 1, b(n-1)+g(3*n, 2))
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(3*n$2)-b(n)+1:
seq(a(n), n=0..35);
MATHEMATICA
b[n_] := b[n] = If[n == 0, 1, b[n - 1] + g[3n, 2]];
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[3n, 3n] - b[n] + 1;
a /@ Range[0, 35] (* Jean-François Alcover, Jan 06 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 20 2020
STATUS
approved