OFFSET
1,1
COMMENTS
Two consecutive terms cannot both be divisible by 4. - Tamas Sandor Nagy, Aug 04 2024
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = n*A007504(n) - Sum_{k=1..n-1} A007504(k) = n*A007504(n) - A014148(n-1). - Pontus von Brömssen, Aug 29 2021
MATHEMATICA
Join[{s=2}, Table[s+=Prime[n]*n, {n, 2, 33}]] (* Vladimir Joseph Stephan Orlovsky, Dec 30 2010 *)
Accumulate[Table[i*Prime[i], {i, 40}]] (* Harvey P. Dale, Sep 10 2014 *)
PROG
(Magma) [&+[k*NthPrime(k): k in [1..n]]: n in [1..40]]; // Bruno Berselli, Apr 30 2011
(PARI) {a(n) = sum(j=1, n, j*prime(j))}; \\ G. C. Greubel, Jun 18 2019
(Sage) [sum(j*nth_prime(j) for j in (1..n)) for n in (1..40)] # G. C. Greubel, Jun 18 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Offset changed to 1 and six terms added by Bruno Berselli, Apr 30 2011
STATUS
approved