cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A184199 Number of partitions of n into an odd number of primes.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 1, 2, 1, 2, 2, 4, 3, 5, 4, 7, 6, 10, 8, 13, 11, 17, 15, 23, 20, 29, 26, 38, 34, 49, 43, 62, 55, 78, 69, 97, 88, 122, 109, 150, 135, 186, 167, 227, 205, 277, 251, 337, 306, 407, 371, 492, 448, 591, 539, 707, 647, 845, 773, 1005, 922, 1193, 1096, 1412, 1298, 1667, 1535, 1963, 1809, 2305, 2127
Offset: 0

Views

Author

R. J. Mathar, Jan 10 2011

Keywords

Examples

			n=18 can be partitioned in A000607(18)=19 ways into primes, of which a(18)=8 are odd, namely  11+5+2, 13+3+2, 5+5+3+3+2, 7+3+3+3+2, 7+5+2+2+2, 3+3+3+3+2+2+2, 5+3+2+2+2+2+2, 2+2+2+2+2+2+2+2+2.
The remaining A184198(18)=11 are even.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = Count[IntegerPartitions[n, All, Prime[Range[PrimePi[n]]]], p_ /; OddQ[Length[p]]];
    Reap[Do[Print[n, " ", a[n]]; Sow[a[n]], {n, 0, 200}]][[2, 1]] (* Jean-François Alcover, Feb 13 2020 *)
  • 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)) - Vec(parts(n, isprime, -1)))/2} \\ Andrew Howroyd, Dec 28 2017

Formula

a(n) = (A000607(n)-A048165(n))/2.

Extensions

a(31)-a(70) corrected by Andrew Howroyd, Dec 28 2017