A239961 Number of partitions of n such that (number of distinct parts) = number of 2's.
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
Offset: 0
Examples
a(10) counts these 4 partitions : 622, 3322, 32221, 22111111.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
Crossrefs
Cf. A239960.
Programs
-
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)): seq(a(n), n=0..70); # Alois P. Heinz, Apr 03 2014
-
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]]; a /@ Range[0, 70] (* Jean-François Alcover, Jun 05 2021, after Alois P. Heinz *)