|
EXAMPLE
|
a(9) counts these 12 partitions: [6,2,1], [5,2,1,1], [4,3,1,1], [4,2,2,1], [4,2,1,1,1], [3,3,1,1,1], [3,2,2,2], [3,2,2,1,1], [3,2,1,1,1,1], [2,2,2,2,1], [2,2,2,1,1,1],[2,2,1,1,1,1,1]; e.g., [2,2,1] is a proper partition of 5, which is the number of parts in [3,2,2,1,1].
|
|
MATHEMATICA
|
Table[parts = IntegerPartitions[z];
Count[Table[rest = Rest[parts[[nn]]];
seq = Map[{#, Flatten[{___, #, ___}]} &,
Rest[IntegerPartitions[Length[rest] + 1]]];
Apply[Or, Map[MatchQ[rest, #[[2]]] &, seq]], {nn, Length[parts]}],
|