login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A344715
Number of partitions of n containing a prime number of distinct primes and an arbitrary number of nonprimes.
1
0, 0, 0, 0, 0, 1, 1, 3, 5, 9, 12, 20, 27, 42, 56, 80, 107, 151, 195, 265, 342, 453, 577, 753, 949, 1220, 1525, 1930, 2398, 3006, 3701, 4594, 5625, 6922, 8426, 10291, 12455, 15117, 18203, 21955, 26326, 31576, 37689, 45002, 53498, 63581, 75313, 89125, 105199, 124056
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
KEYWORD
nonn
AUTHOR
Paolo Xausa, May 27 2021
STATUS
approved