OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n=1..1000
FORMULA
a(n) = 4 + (-1)^n*A008347(n). - Robert Israel, Jun 14 2016
MAPLE
ListTools:-PartialSums([2, seq((-1)^n*ithprime(n), n=2..100)]); # Robert Israel, Jun 14 2016
MATHEMATICA
4 + Accumulate[Table[Prime[n](-1)^(n), {n, 1, 70}]] (* Terry D. Grant, Jun 14 2016 *)
PROG
(PARI) { for (n=1, 1000, if (n==1, a=2, a+=prime(n)*(-1)^n); write("b066033.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 07 2009
CROSSREFS
KEYWORD
sign
AUTHOR
Reinhard Zumkeller, Dec 12 2001
STATUS
approved