OFFSET
1,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
FORMULA
G.f.: sum(x^p(j)/(1+x^p(j)),j>=1)*product(1+x^p(j), j>=1), where p(j) is the j-th prime. - Vladeta Jovovic, Jul 17 2003
EXAMPLE
a(16) = 7 because the partitions of 16 into distinct prime parts are [13,3], [11,5] and [11,3,2].
MAPLE
g:=sum(x^ithprime(j)/(1+x^ithprime(j)), j=1..30)*product(1+x^ithprime(j), j=1..30): gser:=series(g, x=0, 80): seq(coeff(gser, x, n), n=1..75); # Emeric Deutsch, Apr 01 2006
# second Maple program:
with(numtheory):
b:= proc(n, i) option remember; local g;
if n=0 then [1, 0]
elif i<1 then [0, 0]
else g:= `if`(ithprime(i)>n, [0$2], b(n-ithprime(i), i-1));
b(n, i-1) +g +[0, g[1]]
fi
end:
a:= n-> b(n, pi(n))[2]:
seq(a(n), n=1..80); # Alois P. Heinz, Oct 30 2012
MATHEMATICA
Rest@ CoefficientList[ Series[ Sum[x^Prime@j/(1 + x^Prime@j), {j, 20}]* Product[1 + x^Prime@j, {j, 20}], {x, 0, 70}], x] (* Robert G. Wilson v *)
b[n_, i_] := b[n, i] = Module[{g}, If[n==0, {1, 0}, If[i < 1, {0, 0}, g = If[ Prime[i] > n, {0, 0}, b[n - Prime[i], i-1]]; b[n, i-1] + g + {0, g[[1]]}]]]; a[n_] := b[n, PrimePi[n]][[2]]; Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Dec 27 2015, after Alois P. Heinz *)
PROG
(PARI)
sumparts(n, pred)={sum(k=1, n, 1 - 1/(1+pred(k)*x^k) + O(x*x^n))*prod(k=1, n, 1+pred(k)*x^k + O(x*x^n))}
{my(n=60); Vec(sumparts(n, isprime), -n)} \\ Andrew Howroyd, Dec 28 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
EXTENSIONS
More terms from Vladeta Jovovic, Jul 17 2003
STATUS
approved