OFFSET
1,1
COMMENTS
The first differences of A006450. Conjecture: a(n) < log^3 A006450(n) for sufficiently large n. - Thomas Ordowski, Mar 22 2015
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
R. G. Batchko, A prime fractal and global quasi-self-similar structure in the distribution of prime-indexed primes, arXiv preprint arXiv:1405.2900 [math.GM], 2014.
FORMULA
G.f.: (Sum_{ k>=1 } x^pi(pi(k))) -2, with pi(k) the prime counting function. - Benedict W. J. Irwin, Jun 13 2016
EXAMPLE
n=10, prime(11) - prime(10) = 31 - 29 = 2, a(10) = prime(31) - prime(29) = 127 - 109 = 18.
MAPLE
seq(ithprime(ithprime(n+1))-ithprime(ithprime(n)), n = 1..80); # G. C. Greubel, Oct 20 2019
MATHEMATICA
Table[Prime[Prime[n+1]]-Prime[Prime[n]], {n, 80}]
PROG
(PARI) a(n) = prime(prime(n+1)) - prime(prime(n)); \\ Michel Marcus, Jul 01 2016
(PARI) a(n, p=prime(n))=my(q=nextprime(p+1), r=prime(p), s, total); for(i=1, q-p, s=nextprime(r+1); total+=s-r; r=s); total; \\ Charles R Greathouse IV, Dec 30 2018
(Magma) [NthPrime(NthPrime(n+1)) - NthPrime(NthPrime(n)): n in [1..80]]; // G. C. Greubel, Oct 20 2019
(Sage) [nth_prime(nth_prime(n+1)) - nth_prime(nth_prime(n)) for n in (1..80)] # G. C. Greubel, Oct 20 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jul 16 2002
STATUS
approved