A073131 a(n) = prime(prime(n+1)) - prime(prime(n)).
2, 6, 6, 14, 10, 18, 8, 16, 26, 18, 30, 22, 12, 20, 30, 36, 6, 48, 22, 14, 34, 30, 30, 48, 38, 16, 24, 12, 18, 92, 30, 34, 24, 62, 18, 42, 48, 24, 40, 32, 24, 66, 18, 30, 16, 80, 112, 24, 14, 24, 28, 24, 74, 24, 48, 54, 18, 46, 36, 24, 66, 114, 36, 18, 18, 122, 48, 72, 10, 30
Offset: 1
Keywords
Examples
n=10, prime(11) - prime(10) = 31 - 29 = 2, a(10) = prime(31) - prime(29) = 127 - 109 = 18.
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.
Programs
-
Magma
[NthPrime(NthPrime(n+1)) - NthPrime(NthPrime(n)): n in [1..80]]; // G. C. Greubel, Oct 20 2019
-
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}]
-
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
-
Sage
[nth_prime(nth_prime(n+1)) - nth_prime(nth_prime(n)) for n in (1..80)] # G. C. Greubel, Oct 20 2019
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
Comments