OFFSET
17,7
LINKS
Alois P. Heinz, Table of n, a(n) for n = 17..10000
FORMULA
G.f.: Sum_{0<i_1<i_2<i_3<i_4} x^(Sum_{j=1..4} prime(i_j)).
a(n) = [x^n*y^4] Product_{i>=1} (1+x^prime(i)*y).
MAPLE
b:= proc(n, i) option remember; `if`(n=0, [1, 0$4], `if`(i<1, [0$5],
zip((x, y)->x+y, b(n, i-1), [0, `if`(ithprime(i)>n, [0$4],
b(n-ithprime(i), i-1)[1..4])[]], 0)))
end:
a:= n-> b(n, numtheory[pi](n))[5]:
seq(a(n), n=17..100);
MATHEMATICA
k = 4; b[n_, i_] := b[n, i] = If[n == 0, Join[{1}, Array[0&, k]], If[i<1, Array[0&, k+1], Plus @@ PadRight[{b[n, i-1], Join[{0}, If[Prime[i]>n, Array[0&, k], Take[b[n-Prime[i], i-1], k]]]}]]]; a[n_] := b[n, PrimePi[n]][[k+1]]; Table[a[n], {n, 17, 100}] (* Jean-François Alcover, Jan 30 2014, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Nov 14 2012
STATUS
approved