OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
MATHEMATICA
Table[Sum[Prime[k], {k, 1, n}] - n*(n + 1), {n, 1, 50}] (* G. C. Greubel, Oct 08 2016 *)
With[{nn=70}, #[[1]]-#[[2]]&/@Thread[{Accumulate[Prime[Range[ nn]]], Accumulate[ Range[2, 2nn, 2]]}]] (* Harvey P. Dale, Aug 20 2017 *)
PROG
(PARI) g(n) = for(x=1, n, y=sum(j=1, x, 2*j); z=sum(j=1, x, prime(j)); print1(z-y", "))
(PARI) a(n)=my(s, k); forprime(p=2, , if(k++>n, break); s+=p); s-n*(n+1) \\ Charles R Greathouse IV, Oct 08 2016
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Cino Hilliard, Dec 02 2007
STATUS
approved