OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
a(n) ~ n (log n)^2. -Charles R Greathouse IV, May 25 2011
MAPLE
A168152 := proc(n) local p; p := ithprime(n) ; ithprime(p)-p ; end proc: seq(A168152(n), n=1..120) ; # R. J. Mathar, Nov 19 2009
MATHEMATICA
Table[Prime[Prime[n]] - Prime[n], {n, 1, 100}] (* G. C. Greubel, Jul 14 2016 *)
Prime[#]-#&/@Prime[Range[100]] (* Harvey P. Dale, Nov 16 2022 *)
PROG
(Magma) [NthPrime(NthPrime(n))-NthPrime(n): n in [1..60]]; // Vincenzo Librandi, Jul 15 2016
(PARI) a(n) = my(p=prime(n)); prime(p) - p; \\ Michel Marcus, Mar 08 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Nov 19 2009
EXTENSIONS
a(10) corrected by R. J. Mathar, Nov 19 2009
STATUS
approved