OFFSET
0,4
COMMENTS
a(n) is the number of solutions to 0 = Sum_{i=1..n} c_i * prime(i) with c_i in {-1,0,1}. a(3) = 3: -2-3+5, +2+3-5, 0+0+0. - Alois P. Heinz, Dec 28 2023
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..400
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(0, n):
seq(a(n), n=0..40); # Alois P. Heinz, Dec 28 2023
PROG
(PARI) a(n) = polcoef (prod(k=1, n, x^prime(k) + 1 + 1/x^prime(k)), 0); \\ Michel Marcus, Jan 21 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jan 20 2022
STATUS
approved