OFFSET
1,3
COMMENTS
Since A008347 has no duplicate values, a(n) must be finite. This is not true for even results of the sum.
Sums of a single term are not included. - Robert Israel, Feb 06 2025
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
n=5: 11-7+5=2*5-1, 13-11+7=2*5-1, 19-17+13-11+7-5+3=2*5-1, so a(5)=3.
MAPLE
N:= 100: M:= 2*N-1: # for a(1)..a(N)
p:= 1: b:= 0: B:= NULL:
for i from 1 do
p:= nextprime(p);
b:= b + (-1)^i*p;
B:= B, b;
if b > M then nB:= i; break fi;
od:
V:= Vector(M):
for j from 2 to nB by 2 while B[j] <= M do V[B[j]]:= 1 od:
for i from 1 to nB do
for j from i+3 to nB by 2 do
r:= abs(B[j]-B[i]);
if r <= M then V[r]:= V[r]+1 else break fi;
od od:
seq(V[i], i=1..M, 2); # Robert Israel, Feb 06 2025
PROG
(PARI) vb=vecsmall(500); for(k=2, 1000, forstep(l=k-1, 1, -1, t=sum(i=l, k, prime(i)*(-1)^(k-i)); if(t<500, vb[t]=vb[t]+1)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Sep 01 2013
STATUS
approved