|
|
A239241
|
|
Number of partitions of n into distinct parts for which (number of odd parts) = (number of even parts).
|
|
45
|
|
|
1, 0, 0, 1, 0, 2, 0, 3, 0, 4, 1, 5, 2, 6, 5, 7, 8, 8, 14, 9, 20, 11, 30, 13, 40, 17, 55, 23, 70, 32, 91, 45, 112, 65, 140, 91, 169, 128, 206, 177, 245, 241, 295, 323, 350, 429, 419, 559, 499, 722, 600, 921, 721, 1162, 874, 1452, 1062, 1800, 1299, 2210
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,6
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
a(n) = [x^n y^0] Product_{i>=1} 1+x^i*y^(2*(i mod 2)-1). - Alois P. Heinz, Apr 03 2014
|
|
EXAMPLE
|
a(9) = 4 counts these partitions: 81, 72, 63, 54.
|
|
MAPLE
|
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
`if`(n=0, `if`(t=0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
end:
a:= n-> b(n$2, 0):
|
|
MATHEMATICA
|
z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] < Count[#, _?EvenQ] &]], {n, 0, z}] (* A239239 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] <= Count[#, _?EvenQ] &]], {n, 0, z}] (* A239240 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] == Count[#, _?EvenQ] &]], {n, 0, z}] (* A239241 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] > Count[#, _?EvenQ] &]], {n, 0, z}] (* A239242 *)
Table[g[Select[Select[p[n], d[#] == # &], Count[#, _?OddQ] >= Count[#, _?EvenQ] &]], {n, 0, z}] (* A239243 *)
b[n_, i_, t_] := b[n, i, t] = If[n > i*(i+1)/2, 0, If[n==0, If[t==0, 1, 0], b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t + If[Mod[i, 2]==1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Dec 27 2015, after Alois P. Heinz *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|