OFFSET
0,3
COMMENTS
If the largest part is even (odd ), then the second largest part must be odd (even), the third largest part even (odd),...
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Shane Chern, Unlimited parity alternating partitions, arXiv:1803.01031 [math.CO], 2018.
EXAMPLE
The first of the unrestricted partitions not to be counted is 3+1, because the largest part, 3, is odd and the next largest part, 1, is also odd.
MAPLE
b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(i<1, 0,
b(n, i-1, t) +`if`(irem(i+t, 2)=0, 0,
add(b(n-i*j, i-1, 1-t), j=1..n/i))))
end:
a:= n-> `if`(n=0, 1, add(b(n$2, j), j=0..1)):
seq(a(n), n=0..80); # Alois P. Heinz, Aug 17 2014
MATHEMATICA
<<Combinatorica`;
For[n=1, n<=20, n++, count[n]=1;
p={n};
For[index=1, index<=PartitionsP[n]-1, index++,
p=NextPartition[p];
condition=True;
For[i=1, i<=Length[p]-1, i++,
If[((p[[i]]!=p[[i+1]])&&EvenQ[p[[i]]]&&EvenQ[p[[i+1]]])||
((p[[i]]!=p[[i+1]]&&OddQ[p[[i]]])&&OddQ[p[[i+1]]]), condition=False]];
If[condition, count[n]++]];
];
Print[Table[count[i], {i, 1, n-1}]]
CROSSREFS
KEYWORD
nonn
AUTHOR
David S. Newman, Aug 15 2014
EXTENSIONS
More terms from Alois P. Heinz, Aug 17 2014
STATUS
approved