OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n=1..1000
EXAMPLE
a(4) = 2*(3-2) + 3*(5-3) + 5*(7-5) + 7*(11-7) = 46.
MATHEMATICA
Accumulate@ Array[# (NextPrime@ # - #) &@ Prime@ # &, {43}] (* Michael De Vlieger, May 05 2016 *)
PROG
(PARI) d(n) = prime(n+1)-prime(n); j=[]; for(n=1, 150, j=concat(j, sum(k=1, n, prime(k)*d(k)))); j
(PARI) d(n)= { prime(n + 1) - prime(n) }
{ a=0; for (n=1, 1000, write("b064009.txt", n, " ", a+=prime(n)*d(n)) ) } \\ Harry J. Smith, Sep 05 2009
(Sage) p=primes_first_n(44); d=differences(p); v=[]; a=0
for k in range(len(d)):
a+=p[k]*d[k]; v.append(a)
print(v) # Giuseppe Coppoletta, May 05 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Jason Earls, Sep 06 2001
STATUS
approved