login
Number of partitions of n into five primes.
18

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

%S 0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,3,3,5,4,6,6,7,6,10,7,11,9,12,11,17,

%T 11,18,13,20,14,24,15,27,18,29,21,35,19,38,24,41,26,47,26,53,30,54,34,

%U 64,33,70,38,73,41,81,41,89,45,92,50,103,47,112,56,117,61,127,57

%N Number of partitions of n into five primes.

%H David A. Corneth, <a href="/A259195/b259195.txt">Table of n, a(n) for n = 0..10000</a> (first 5001 terms from Doug Bell)

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

%H Sean A. Irvine, <a href="https://github.com/archmageirvine/joeis/blob/master/src/irvine/oeis/a259/A259195.java">Java program</a> (github)

%F a(n) = Sum_{l=1..floor(n/5)} Sum_{k=l..floor((n-l)/4)} Sum_{j=k..floor((n-k-l)/3)} Sum_{i=j..floor((n-j-k-l)/2)} c(i) * c(j) * c(k) * c(l) * c(n-i-j-k-l), where c = A010051. - _Wesley Ivan Hurt_, Apr 17 2019

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

%e a(17) = 3 because 17 can be written as the sum of five primes in exactly three ways: 2+2+3+3+7, 2+2+3+5+5, and 3+3+3+3+5.

%t Array[Count[IntegerPartitions[#, {5}], _?(AllTrue[#, PrimeQ] &)] &, 71] (* _Michael De Vlieger_, Apr 21 2019 *)

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

%o (Magma) [0] cat [#RestrictedPartitions(n,5,{p:p in PrimesUpTo(n)}):n in [1..70]]; // _Marius A. Burtea_, May 09 2019

%Y Column k=5 of A117278.

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

%Y Cf. A000040.

%K nonn,easy

%O 0,14

%A _Doug Bell_, Jun 20 2015

%E More terms from _David A. Corneth_, Sep 06 2020