OFFSET
0,10
COMMENTS
Let c(n) be the number of strict partitions (that is, every part has multiplicity 1) of n having 1 more odd part than even, so that there is an ordering of parts for which the odd and even parts alternate and the first and last terms are odd. Then c(n) = a(n+1) for n >= 0.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = [x^n y^(-1)] Product_{i>=1} 1+x^i*y^(2*(i mod 2)-1). - Alois P. Heinz, Apr 03 2014
EXAMPLE
a(11) counts these 4 partitions: 812, 614, 632, 452.
MAPLE
b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2 or
abs(t)>n, 0, `if`(n=0, 1, b(n, i-1, t)+
`if`(i>n, 0, b(n-i, i-1, t+(2*irem(i, 2)-1)))))
end:
a:= n-> b(n$2, 1):
seq(a(n), n=0..80); # Alois P. Heinz, Apr 02 2014
MATHEMATICA
d[n_] := Select[IntegerPartitions[n], Max[Length /@ Split@#] == 1 &];
p[n_] := p[n] = Select[d[n], Count[#, _?OddQ] == -1 + Count[#, _?EvenQ] &]; t = Table[p[n], {n, 0, 20}]
TableForm[t] (* shows the partitions *)
u = Table[Length[p[n]], {n, 0, 70}] (* A239871 *)
(* Peter J. C. Moses, Mar 10 2014 *)
b[n_, i_, t_] := b[n, i, t] = If[n > i*(i + 1)/2 || Abs[t] > n, 0, If[n == 0, 1, b[n, i - 1, t] + If[i > n, 0, b[n - i, i - 1, t + (2*Mod[i, 2] - 1)]]]]; a[n_] := b[n, n, 1]; Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Nov 16 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Mar 29 2014
STATUS
approved