OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1) = 2 + 1 - 2 = 1;
a(2) = 2 - 2 + 3 = 3;
a(3) = 2 + 3 - 4 + 5 = 6;
a(4) = 2 - 4 + 5 - 6 + 7 = 4;
a(5) = 2 + 5 - 6 + 7 - 8 + 9 - 10 + 11 = 10.
MAPLE
A163294 := proc(n) 2+add( -j*(-1)^j, j=n..ithprime(n)) ; end: seq(A163294(n), n=1..120) ; # R. J. Mathar, Oct 10 2009
MATHEMATICA
Table[2 + Sum[k*(-1)^(k + 1), {k, n, Prime[n]}], {n, 1, 100}] (* G. C. Greubel, Dec 17 2016 *)
PROG
(PARI) for(n=1, 50, print1(2 + sum(k=n, prime(n), k*(-1)^(k+1)), ", ")) \\ G. C. Greubel, Dec 17 2016
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Juri-Stepan Gerasimov, Jul 24 2009
EXTENSIONS
Corrected by Juri-Stepan Gerasimov, Jul 26 2009
Edited (but not checked) by N. J. A. Sloane, Jul 27 2009
Roughly 50 percent of the entries corrected by R. J. Mathar, Oct 10 2009
STATUS
approved