A184198 Number of partitions of n into an even number of primes.
1, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 2, 4, 4, 6, 5, 8, 7, 11, 10, 15, 13, 20, 17, 26, 23, 34, 29, 43, 38, 55, 49, 69, 62, 88, 78, 109, 97, 135, 122, 167, 150, 205, 186, 251, 227, 306, 277, 371, 337, 448, 407, 539, 492, 647, 591, 773, 707, 922, 845, 1096, 1005, 1298, 1193, 1535, 1412, 1809, 1667, 2127
Offset: 0
Examples
n=18 can be partitioned in A000607(18)=19 ways into primes, of which a(18)=11 are even, namely 11+7, 13+5, 5+5+5+3, 7+5+3+3, 3+3+3+3+3+3, 7+7+2+2, 11+3+2+2, 5+3+3+3+2+2, 5+5+2+2+2+2, 7+3+2+2+2+2, 3+3+2+2+2+2+2+2. The remaining A184199(18)=8 are odd.
Links
- Vaclav Kotesovec, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
Table[Count[IntegerPartitions[n],?(AllTrue[#,PrimeQ]&&EvenQ[Length[ #]]&)], {n,0,70}] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale, Feb 16 2018 *)
-
PARI
parts(n, pred, y)={prod(k=1, n, if(pred(k), 1/(1-y*x^k) + O(x*x^n), 1))} {my(n=80); Vec(parts(n, isprime, 1) + parts(n, isprime, -1))/2} \\ Andrew Howroyd, Dec 28 2017
Extensions
a(31)-a(69) corrected by Andrew Howroyd, Dec 28 2017