

A031131


Difference between nth prime and (n+2)nd prime.


41



3, 4, 6, 6, 6, 6, 6, 10, 8, 8, 10, 6, 6, 10, 12, 8, 8, 10, 6, 8, 10, 10, 14, 12, 6, 6, 6, 6, 18, 18, 10, 8, 12, 12, 8, 12, 10, 10, 12, 8, 12, 12, 6, 6, 14, 24, 16, 6, 6, 10, 8, 12, 16, 12, 12, 8, 8, 10, 6, 12, 24, 18, 6, 6, 18, 20, 16, 12, 6, 10, 14, 14, 12, 10, 10, 14, 12, 12, 18, 12, 12, 12
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

Distance between the pair of primes adjacent to the (n+1)st prime.  Lekraj Beedassy, Oct 01 2004 [Typo corrected by Zak Seidov, Feb 22 2009]
The Polymath project 8b proved that a(n) <= 395106 infinitely often (their published paper contains the slightly weaker bound a(n) <= 398130 infinitely often).  Charles R Greathouse IV, Jul 22 2016


LINKS



FORMULA



EXAMPLE

a(10)=8 because the 10th prime=29 is followed by primes 31 and 37, and 37  29 = 8.


MAPLE

P:= select(isprime, [2, seq(2*i+1, i=1..1000)]):


MATHEMATICA

Map[#3  #1 & @@ # &, Partition[Prime@ Range[84], 3, 1]] (* Michael De Vlieger, Dec 17 2017 *)


PROG

(MuPAD) ithprime(i+2)ithprime(i) $ i = 1..65 // Zerinvary Lajos, Feb 26 2007
(Sage)
BB = primes_first_n(67)
L = []
for i in range(65):
L.append(BB[2+i]BB[i])
L
(Magma) [NthPrime(n+2)NthPrime(n): n in [1..100] ]; // Vincenzo Librandi, Apr 11 2011
(Haskell)
a031131 n = a031131_list !! (n1)
a031131_list = zipWith () (drop 2 a000040_list) a000040_list


CROSSREFS

Sum of consecutive terms of A001223.
Cf. A031132, A031133, A031134, A122412, A122413,A046931, A000040, A031165, A031166, A031167, A031168, A031169, A031170, A031171, A031172, A261525.
Cf. A075527 (allowing 1 to be prime).


KEYWORD

nonn


AUTHOR



EXTENSIONS



STATUS

approved



