OFFSET
0,4
COMMENTS
a(n) is the number of solutions to n = Sum_{i=1..n} c_i * prime(i) with c_i in {-1,0,1}.
MAPLE
s:= proc(n) s(n):= `if`(n<1, 0, ithprime(n)+s(n-1)) end:
b:= proc(n, i) option remember; `if`(n>s(i), 0, `if`(i=0, 1,
b(n, i-1)+b(n+ithprime(i), i-1)+b(abs(n-ithprime(i)), i-1)))
end:
a:= n-> b(n$2):
seq(a(n), n=0..32); # Alois P. Heinz, Jan 25 2024
MATHEMATICA
Table[Coefficient[Product[x^Prime[k] + 1 + 1/x^Prime[k], {k, 1, n}], x, n], {n, 0, 31}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jan 25 2024
STATUS
approved