OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2000
J. Kelleher, B. O'Sullivan, Generating All Partitions: A Comparison Of Two Encodings, arXiv:0909.2331 [cs.DS], 2009, 2014.
J. Stauduhar, Python program
FORMULA
a(n) = A222656(3*n,n).
EXAMPLE
For n = 3: the five partitions of 3 * 3 = 9 that have exactly three prime parts are (5, 2, 2), (3, 3, 3), (3, 3, 2, 1), (3, 2, 2, 1, 1), and (2, 2, 2, 1, 1, 1), so a(3) = 5.
MATHEMATICA
zip[f_, x_, y_, z_] := With[{m = Max[Length[x], Length[y]]}, Thread[f[ PadRight[x, m, z], PadRight[y, m, z]]]];
b[n_, i_] := b[n, i] = Module[{j, pc}, Which[n == 0, {1}, i < 1, {0}, True, pc = {}; For[j = 0, j <= n/i, j++, pc = zip[Plus, pc, Join[If[PrimeQ[i], Array[0 &, j], {}], b[n - i*j, i - 1]], 0]]; pc]];
a[n_] := b[3 n, 3 n][[n + 1]];
Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Mar 16 2018, after Alois P. Heinz *)
PROG
(Python) See Stauduhar link.
(PARI) a(n) = {my(nb = 0); forpart(p=3*n, if (sum(k=1, #p, isprime(p[k])) == n, nb++); ); nb; } \\ Michel Marcus, Mar 22 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
J. Stauduhar, Feb 18 2018
STATUS
approved