OFFSET
0,8
EXAMPLE
a(10) = 12 because there are 12 partitions of 10 that contain a prime number of primes (not counting repetitions). These partitions are [7,3] (containing 2 primes), [7,2,1] (containing 2 primes), [5,3,2] (containing 3 primes), [5,3,1,1] (containing 2 primes), [5,2,2,1] (containing 2 distinct primes), [5,2,1,1,1] (containing 2 primes), [4,3,2,1] (containing 2 primes), [3,3,2,2] (containing 2 distinct primes), [3,3,2,1,1] (containing 2 distinct primes), [3,2,2,2,1] (containing 2 distinct primes), [3,2,2,1,1,1] (containing 2 distinct primes) and [3,2,1,1,1,1,1] (containing 2 primes).
MAPLE
b:= proc(n, i) option remember; expand(
`if`(n=0 or i=1, 1, b(n, i-1)+`if`(isprime(i), x, 1)
*add(b(n-i*j, i-1), j=1..n/i)))
end:
a:= n-> (p-> add(`if`(isprime(i), coeff(p, x, i), 0),
i=2..degree(p)))(b(n$2)):
seq(a(n), n=0..49); # Alois P. Heinz, Nov 14 2021
MATHEMATICA
nterms=50; Table[Total[Map[If[PrimeQ[Count[#, _?PrimeQ]], 1, 0] &, Map[DeleteDuplicates[#]&, IntegerPartitions[n], {1}]]], {n, 0, nterms-1}]
PROG
(PARI) seq(n)={my(p=prod(k=2, n, 1 - y + y/(1 - if(isprime(k), x^k)) + O(x*x^n) ) ); Vec(sum(k=2, n, if(isprime(k), polcoef(p, k, y)))/eta(x+O(x*x^n))/subst(p, y, 1), -(n+1))} \\ Andrew Howroyd, May 27 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo Xausa, May 27 2021
STATUS
approved