OFFSET
1,2
COMMENTS
a(n) is also the area under the curve of the function pi(x) from prime(n) to prime(n+1), see the illustration of initial terms. This sequence is also the first differences of A152535. - Omar E. Pol, Nov 13 2013
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Omar E. Pol, Illustration of initial terms
FORMULA
a(n) = n*(1 + A046933(n)). [Omar E. Pol, Nov 16 2008]
EXAMPLE
a(5)=10 because the 5th prime is 11 and the 6th prime is 13. The 5th gap between primes is 2, then a(5)=5*2=10.
MAPLE
P:= [seq(ithprime(i), i=1..1001)]:
seq(n*(P[n+1]-P[n]), n=1..1000); # Robert Israel, Nov 26 2015
MATHEMATICA
Table[n*(Prime[n+1] - Prime[n]), {n, 100}] (* T. D. Noe, Nov 14 2013 *)
With[{nn=60}, Times@@@Thread[{Range[nn], Differences[Prime[Range[nn+1]]]}]] (* Harvey P. Dale, Dec 18 2018 *)
PROG
(PARI) diff(v)=vector(#v-1, i, (v[i+1]-v[i])*i);
diff(primes(100)) \\ Altug Alkan, Nov 26 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Omar E. Pol, Jul 30 2008
EXTENSIONS
Corrected definition and example. - Omar E. Pol, Nov 16 2008
Name and example corrected by Bob Selcoe and Robert Israel, Nov 26 2015
STATUS
approved