OFFSET
0,9
FORMULA
a(n) = [x^n] Product_{k=1..n-1} (x^prime(k) + 1/x^prime(k)).
MATHEMATICA
Table[SeriesCoefficient[Product[x^Prime[k] + 1/x^Prime[k], {k, n - 1}], {x, 0, n}], {n, 0, 40}] (* Stefano Spezia, Jan 30 2022 *)
PROG
(Python)
from sympy import sieve, primerange
from functools import cache
@cache
def b(n, i):
maxsum = 0 if i < 2 else sum(p for p in primerange(2, sieve[i-1]+1))
if n > maxsum: return 0
if i < 2: return 1
return b(n+sieve[i-1], i-1) + b(abs(n-sieve[i-1]), i-1)
def a(n): return b(n, n)
print([a(n) for n in range(41)]) # Michael S. Branicky, Jan 29 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jan 29 2022
STATUS
approved