|
|
A239961
|
|
Number of partitions of n such that (number of distinct parts) = number of 2's.
|
|
2
|
|
|
1, 0, 1, 0, 0, 1, 1, 2, 2, 2, 4, 4, 6, 9, 10, 12, 19, 21, 24, 36, 44, 49, 66, 81, 100, 123, 144, 180, 229, 265, 317, 391, 473, 566, 675, 798, 968, 1154, 1354, 1621, 1926, 2241, 2675, 3170, 3691, 4345, 5113, 5956, 7002, 8182, 9503, 11095, 12919, 14976, 17446
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,8
|
|
LINKS
|
|
|
EXAMPLE
|
a(10) counts these 4 partitions : 622, 3322, 32221, 22111111.
|
|
MAPLE
|
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
b(n, i-1)+`if`(i=2, 0, add(b(n-2-i*j, i-1), j=1..(n-2)/i))))
end:
a:= n-> `if`(n=0, 1, b(n-2$2)):
|
|
MATHEMATICA
|
z = 54; d[p_] := d[p] = Length[DeleteDuplicates[p]]; Table[Count[IntegerPartitions[n], p_ /; d[p] == Count[p, 2]], {n, 0, z}]
(* Second program: *)
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i-1] +
If[i == 2, 0, Sum[b[n-2-i*j, i-1], {j, 1, (n-2)/i}]]]];
a[n_] := If[n == 0, 1, b[n-2, n-2]];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|