OFFSET
1,4
COMMENTS
+-p(1)+-p(2)+-...+-p(2n) = 2 has no solutions, since the left hand side is odd.
LINKS
Ray Chandler, Table of n, a(n) for n = 1..1000 (first 120 terms from Alois P. Heinz)
FORMULA
a(n) = [x^2] Product_{k=1..2*n-1} (x^prime(k) + 1/x^prime(k)). - Ilya Gutkovskiy, Jan 30 2024
MAPLE
A113041:=proc(n) local i, j, p, t; t:= NULL; for j to 2*n-1 by 2 do p:=1; for i to j do p:=p*(x^(-ithprime(i))+x^(ithprime(i))); od; t:=t, coeff(p, x, 2); od; t; end;
# second Maple program
sp:= proc(n) sp(n):= `if`(n=0, 0, ithprime(n)+sp(n-1)) end:
b := proc(n, i) option remember; `if`(n>sp(i), 0, `if`(i=0, 1,
b(n+ithprime(i), i-1)+ b(abs(n-ithprime(i)), i-1)))
end:
a:= n-> b(2, 2*n-1):
seq(a(n), n=1..30); # Alois P. Heinz, Aug 05 2012
MATHEMATICA
sp[n_] := sp[n] = If[n == 0, 0, Prime[n] + sp[n-1]];
b[n_, i_] := b[n, i] = If[n > sp[i], 0, If[i == 0, 1, b[n + Prime[i], i-1] + b[Abs[n - Prime[i]], i-1]]];
a[n_] := b[2, 2n-1];
Array[a, 30] (* Jean-François Alcover, Nov 02 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Floor van Lamoen, Oct 12 2005
STATUS
approved