login
Number of partitions of n into nine primes.
22

%I #46 Sep 08 2022 08:46:13

%S 1,1,1,2,2,3,4,4,5,7,7,9,10,11,12,16,16,20,21,24,26,33,31,39,39,47,46,

%T 59,53,69,65,80,77,98,85,114,104,131,118,154,133,179,155,200,177,236,

%U 196,268,227,300,256

%N Number of partitions of n into nine primes.

%H Robert Israel, <a href="/A259200/b259200.txt">Table of n, a(n) for n = 18..10000</a>

%H <a href="/index/Par#part">Index entries for sequences related to partitions</a>

%F a(n) = [x^n y^9] Product_{k>=1} 1/(1 - y*x^prime(k)). - _Ilya Gutkovskiy_, Apr 18 2019

%F a(n) = Sum_{q=1..floor(n/9)} Sum_{p=q..floor((n-q)/8)} Sum_{o=p..floor((n-p-q)/7)} Sum_{m=o..floor((n-o-p-q)/6)} Sum_{l=m..floor((n-m-o-p-q)/5)} Sum_{k=l..floor((n-l-m-o-p-q)/4)} Sum_{j=k..floor((n-k-l-m-o-p-q)/3)} Sum_{i=j..floor((n-j-k-l-m-o-p-q)/2)} A010051(q) * A010051(p) * A010051(o) * A010051(m) * A010051(l) * A010051(k) * A010051(j) * A010051(i) * A010051(n-i-j-k-l-m-o-p-q). - _Wesley Ivan Hurt_, Jul 13 2019

%e a(23) = 3 because there are 3 partitions of 23 into nine primes: [2,2,2,2,2,2,2,2,7], [2,2,2,2,2,2,3,3,5] and [2,2,2,2,3,3,3,3,3].

%p N:= 100: # to get a(0) to a(N)

%p Primes:= select(isprime,[$1..N]):

%p np:= nops(Primes):

%p for j from 0 to np do g[0,j]:= 1 od:

%p for n from 1 to 9 do

%p g[n,0]:= 0:

%p for j from 1 to np do

%p g[n,j]:= convert(series(add(g[k,j-1]

%p *x^((n-k)*Primes[j]),k=0..n),x,N+1),polynom)

%p od

%p od:

%p seq(coeff(g[9,np],x,i),i=18..N) # _Robert Israel_, Jun 21 2015

%t Table[Length[Select[IntegerPartitions[n],Length[#]==9&&AllTrue[ #, PrimeQ]&]], {n,18,70}] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Jul 31 2016 *)

%o (PARI) a(n) = {nb = 0; forpart(p=n, if (#p && (#select(x->isprime(x), Vec(p)) == #p), nb+=1), , [9,9]); nb;} \\ _Michel Marcus_, Jun 21 2015

%o (Magma) [#RestrictedPartitions(k,9,Set(PrimesUpTo(1000))):k in [18..70]] ; // _Marius A. Burtea_, Jul 13 2019

%Y Column k=9 of A117278.

%Y Number of partitions of n into r primes for r = 1..10: A010051, A061358, A068307, A259194, A259195, A259196, A259197, A259198, this sequence, A259201.

%Y Cf. A000040.

%K nonn,easy

%O 18,4

%A _Doug Bell_, Jun 20 2015