|
|
A242984
|
|
Number of partitions of n where the frequencies alternate in parity.
|
|
1
|
|
|
1, 1, 2, 2, 4, 4, 6, 7, 11, 12, 15, 19, 26, 30, 37, 42, 58, 64, 82, 92, 120, 129, 167, 181, 241, 252, 326, 346, 450, 474, 606, 641, 822, 863, 1088, 1146, 1454, 1526, 1898, 2010, 2494, 2638, 3232, 3437, 4195, 4458, 5381, 5748, 6928, 7389, 8805, 9446, 11217
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Let the frequency of the largest summand be f1, the frequency of the next smaller summand be f2, etc. Then the sequence f1, f2, f3, ... alternates in parity.
|
|
LINKS
|
|
|
EXAMPLE
|
For example the partition 3,2,2,1 is counted since the frequency of 3 is 1; the frequency of 2 is 2; and the frequency of 1 is 1. So the sequence of frequencies is 1,2,1. Since the terms of this sequence are odd, even, odd this partition is counted.
|
|
MAPLE
|
b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(i<1, 0,
b(n, i-1, t) +add(`if`(irem(j+t, 2)=0, 0,
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)):
|
|
MATHEMATICA
|
<<Combinatorica`;
For[n=1, n<=30, n++, count[n]=1;
p={n};
For[index=1, index <= PartitionsP[n]-1, index++,
p=NextPartition[p];
tally=Tally[p];
freq=Table[tally[[i]][[2]], {i, 1, Length[tally]}];
condition=True;
For[i=1, i<=Length[freq]-1, i++,
If[(EvenQ[freq[[i]]]&&EvenQ[freq[[i+1]]])||
((OddQ[freq[[i]]])&&OddQ[freq[[i+1]]]), condition=False]]
If[condition, count[n]++]];
];
Print[Table[count[i], {i, 1, n-1}]]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|