OFFSET
1,4
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..200
FORMULA
Constant term in the expansion of 1/2 * Product_{k=1..2*n} (x^prime(2*k+1) + 1/x^prime(2*k+1)).
EXAMPLE
For n=2 the solution is 5-11-17+23 = 0.
For n=3 the solution is 5+11+17-23+31-41 = 0.
For n=4 the 2 solutions are 5-11+17+23+31+41-47-59 = 0 and 5+11-17+23+31-41+47-59 = 0.
MAPLE
s:= proc(n) s(n):= `if`(n=0, 0, ithprime(2*n+1)+s(n-1)) end:
b:= proc(n, i) option remember; `if`(n>s(i), 0, `if`(i=0, 1,
(p-> b(n+p, i-1)+b(abs(n-p), i-1))(ithprime(2*i+1))))
end:
a:= n-> b(0, 2*n)/2:
seq(a(n), n=1..30); # Alois P. Heinz, Sep 21 2017
MATHEMATICA
s[n_] := s[n] = If[n == 0, 0, Prime[2n+1] + s[n-1]];
b[n_, i_] := b[n, i] = If[n > s[i], 0, If[i == 0, 1,
With[{p = Prime[2i+1]}, b[n+p, i-1] + b[Abs[n-p], i-1]]]];
a[n_] := b[0, 2n]/2;
Table[a[n], {n, 1, 30}] (* Jean-François Alcover, Apr 30 2022, after Alois P. Heinz *)
PROG
(PARI) {a(n) = 1/2*polcoeff(prod(k=1, 2*n, x^prime(2*k+1)+1/x^prime(2*k+1)), 0)}
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Sep 21 2017
STATUS
approved
