OFFSET
1,1
LINKS
Bruno Berselli, Table of n, a(n) for n = 1..5000
EXAMPLE
a(4) = 4*prime(4) - (prime(3) + prime(2) + prime(1)) = 4*7 - (5 + 3 + 2) = 18.
MATHEMATICA
nn=50; Join[{2}, With[{prs=Accumulate[Prime[Range[nn]]]}, Table[n*Prime[n]-prs[[n-1]], {n, 2, nn}]]] (* Harvey P. Dale, Nov 21 2014 *)
PROG
(Magma) [2] cat [n*NthPrime(n)-(&+[NthPrime(k): k in [1..n-1]]): n in [2..47]];
(PARI) v=vector(10000); s=n=i=0; forprime(p=2, 1e9, v[i++]=n++*p-s; if(i==#v, return, s+=p)) \\ Charles R Greathouse IV, May 01 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Apr 30 2011
STATUS
approved