OFFSET
1,1
LINKS
Dmitry Kamenetsky, Table of n, a(n) for n = 1..10000 (first 144 terms by Paolo P. Lava and Giorgio Balzarotti)
FORMULA
EXAMPLE
5 = abs(2-3+5-7+11-13) (first 6 primes),
7 = abs(2-3+5-7+11-13+17-19) (first 8 primes),
etc.
MAPLE
P:=proc(n) local i, s; s:=0; for i from 1 by 1 to n do s:=s+(-1)^i*ithprime(i); if isprime(abs(s)) then print(abs(s)); fi; od; end: P(1000);
MATHEMATICA
Select[Abs@Accumulate@Table[(-1)^(k+1)*Prime@k, {k, 355}], PrimeQ] (* Giorgos Kalogeropoulos, Sep 22 2021 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Mar 20 2008
STATUS
approved