[go: up one dir, main page]

login
A184172
Number of partitions of n into an odd number of distinct primes.
10
0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 3, 3, 4, 3, 5, 3, 4, 4, 5, 5, 6, 6, 7, 5, 7, 7, 8, 8, 8, 9, 11, 9, 10, 11, 12, 12, 14, 13, 16, 14, 16, 15, 19, 17, 20, 20, 22, 20, 23, 24, 27, 26, 28, 27, 33, 30, 34, 34, 37, 36, 41, 40, 46, 43, 47, 46, 55, 50, 56
OFFSET
0,19
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000 (terms 0..2000 from Alois P. Heinz)
FORMULA
G.f.: (1/2)*[Product_{k>=1} (1+z^prime(k)) - Product_{k>=1} (1-z^prime(k))].
a(n) = Sum_{k>=0} A219180(n,2*k+1). - Alois P. Heinz, Nov 15 2012
a(n) + A184171(n) = A000586(n). - R. J. Mathar, Mar 31 2023
EXAMPLE
a(33) = 4 because we have [23,7,3], [19,11,3], [17,13,3], and [17,11,5].
MAPLE
g := 1/2*(Product(1+z^ithprime(k), k = 1 .. 120)-Product(1-z^ithprime(k), k = 1 .. 120)): gser := series(g, z = 0, 110): seq(coeff(gser, z, n), n = 0 .. 85);
# second Maple program
with(numtheory):
b:= proc(n, i) option remember;
`if`(n=0, [1], `if`(i<1, [], zip((x, y)->x+y, b(n, i-1),
[0, `if`(ithprime(i)>n, [], b(n-ithprime(i), i-1))[]], 0)))
end:
a:= proc(n) local l; l:= b(n, pi(n));
add(l[2*i], i=1..iquo(nops(l), 2))
end:
seq(a(n), n=0..100); # Alois P. Heinz, Nov 15 2012
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, {1}, If[i<1, {}, Plus @@ PadRight[{b[n, i-1], Join[{0}, If[Prime[i]>n, {}, b[n-Prime[i], i-1]]]}]]]; a[n_] := Module[{l}, l = b[n, PrimePi[n]]; Sum[l[[2*i]], {i, 1, Quotient[Length[l], 2]}]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jan 30 2014, after Alois P. Heinz *)
PROG
(PARI)
parts(n, pred, y)={prod(k=1, n, 1 + if(pred(k), y*x^k + O(x*x^n), 0))}
{my(n=80); (Vec(parts(n, isprime, 1)) - Vec(parts(n, isprime, -1)))/2} \\ Andrew Howroyd, Dec 28 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch (suggested by R. J. Mathar), Jan 09 2011
STATUS
approved