OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
A. Frank & P. Jacqueroux, International Contest, 2001. Item 20.
FORMULA
a(n) = n + (prime(n+1) - prime(n)) = n + A001223(n).
From G. C. Greubel, Aug 03 2021: (Start)
a(n) = prime(n+1) - A014689(n). (End)
MATHEMATICA
With[{nn=80}, Total/@Thread[{Differences[Prime[Range[nn]]], Range[nn-1]}]] (* Harvey P. Dale, Jun 02 2014 *)
PROG
(PARI) for(n=1, 100, print1(prime(n+1)-prime(n)+n, ", "))
(Magma) [n + NthPrime(n+1) - NthPrime(n): n in [1..80]]; // G. C. Greubel, Aug 03 2021
(Sage) [n + nth_prime(n+1) - nth_prime(n) for n in (1..80)] # G. C. Greubel, Aug 03 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Herman Jamke (hermanjamke(AT)fastmail.fm), Sep 30 2006
STATUS
approved