login
a(n) = prime(prime(n+1)) - prime(prime(n)).
6

%I #30 Sep 08 2022 08:45:06

%S 2,6,6,14,10,18,8,16,26,18,30,22,12,20,30,36,6,48,22,14,34,30,30,48,

%T 38,16,24,12,18,92,30,34,24,62,18,42,48,24,40,32,24,66,18,30,16,80,

%U 112,24,14,24,28,24,74,24,48,54,18,46,36,24,66,114,36,18,18,122,48,72,10,30

%N a(n) = prime(prime(n+1)) - prime(prime(n)).

%C The first differences of A006450. Conjecture: a(n) < log^3 A006450(n) for sufficiently large n. - _Thomas Ordowski_, Mar 22 2015

%H Charles R Greathouse IV, <a href="/A073131/b073131.txt">Table of n, a(n) for n = 1..10000</a>

%H R. G. Batchko, <a href="http://arxiv.org/abs/1405.2900">A prime fractal and global quasi-self-similar structure in the distribution of prime-indexed primes</a>, arXiv preprint arXiv:1405.2900 [math.GM], 2014.

%F a(n) = A006450(n+1) - A006450(n). - _Thomas Ordowski_, Mar 22 2015

%F G.f.: (Sum_{ k>=1 } x^pi(pi(k))) -2, with pi(k) the prime counting function. - _Benedict W. J. Irwin_, Jun 13 2016

%e n=10, prime(11) - prime(10) = 31 - 29 = 2, a(10) = prime(31) - prime(29) = 127 - 109 = 18.

%p seq(ithprime(ithprime(n+1))-ithprime(ithprime(n)), n = 1..80); # _G. C. Greubel_, Oct 20 2019

%t Table[Prime[Prime[n+1]]-Prime[Prime[n]], {n, 80}]

%o (PARI) a(n) = prime(prime(n+1)) - prime(prime(n)); \\ _Michel Marcus_, Jul 01 2016

%o (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

%o (Magma) [NthPrime(NthPrime(n+1)) - NthPrime(NthPrime(n)): n in [1..80]]; // _G. C. Greubel_, Oct 20 2019

%o (Sage) [nth_prime(nth_prime(n+1)) - nth_prime(nth_prime(n)) for n in (1..80)] # _G. C. Greubel_, Oct 20 2019

%Y Cf. A073130, A073132.

%K nonn

%O 1,1

%A _Labos Elemer_, Jul 16 2002