login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A369560
a(n) = [x^n] Product_{k=1..n} (x^prime(k) + 1 + 1/x^prime(k)).
1
1, 0, 1, 2, 3, 6, 16, 38, 91, 225, 547, 1407, 3570, 9250, 24578, 65740, 175626, 470084, 1279101, 3482419, 9547953, 26445796, 73251187, 203818706, 567543095, 1577629707, 4408095456, 12400615844, 34995570604, 99241500366, 282037360250, 795846583187
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}]
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jan 25 2024
STATUS
approved