A prime gap is the difference between two successive prime numbers. The n {\displaystyle n} -th prime gap, denoted g n {\displaystyle g_{n}} or g ( p n ) {\displaystyle g(p_{n})} is the difference between the ( n + 1 ) {\displaystyle (n+1)} th and the n {\displaystyle n} -th prime numbers, i.e.,
g n = p n + 1 − p n {\displaystyle g_{n}=p_{n+1}-p_{n}}
For example, since the first few primes are 2, 3, 5, 7, 11..., we have g 1 = 1 {\displaystyle g_{1}=1} , g 2 = g 3 = 2 {\displaystyle g_{2}=g_{3}=2} , g 4 = 4 {\displaystyle g_{4}=4} . The sequence g n {\displaystyle g_{n}} of prime gaps has been extensively studied; however, many questions and conjectures remain unanswered. The first 60 prime gaps are:
1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 6, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 10, 6, 6, 6, 2, 6, 4, 2, ... (sequence A001223 in the OEIS). By the definition of g n {\displaystyle g_{n}} every prime can be written as
p n + 1 = 2 + ∑ i = 1 n g i . {\displaystyle p_{n+1}=2+\sum _{i=1}^{n}g_{i}.}
Simple observations The first, smallest, and only odd prime gap is the gap of size 1 between 2, the only even prime number, and 3, the first odd prime. All other prime gaps are even. There is only one pair of consecutive gaps having length 2: the gaps g 2 {\displaystyle g_{2}} and g 3 {\displaystyle g_{3}} between the primes 3, 5, and 7. For any integer n {\displaystyle n} , the factorial n ! {\displaystyle n!} is the product of all positive integers up to and including n {\displaystyle n} . Then in the sequence
n ! + 2 , n ! + 3 , … , n ! + n , {\displaystyle n!+2,\;n!+3,\;\ldots ,\;n!+n,}
the first term is divisible by 2, the second term is divisible by 3, and so on. Thus, this is a sequence of n − 1 consecutive composite integers, and it must belong to a gap between primes having length at least n {\displaystyle n} . It follows that there are gaps between primes that are arbitrarily large, that is, for any integer N {\displaystyle N} , there is an integer m {\displaystyle m} with g m ≥ N {\displaystyle g_{m}\geq N} . However, prime gaps of n {\displaystyle n} numbers can occur at numbers much smaller than n ! {\displaystyle n!} . For instance, the first prime gap of size larger than 14 occurs between the primes 523 and 541, while 15! is the vastly larger number 1 307 674 368 000. The average gap between primes increases as the natural logarithm of these primes, and therefore the ratio of the prime gap to the primes involved decreases (and is asymptotically zero). This is a consequence of the prime number theorem. From a heuristic view, we expect the probability that the ratio of the length of the gap to the natural logarithm is greater than or equal to a fixed positive number k {\displaystyle k} to be e − k {\displaystyle e^{-k}} ; consequently the ratio can be arbitrarily large. Indeed, the ratio of the gap to the number of digits of the integers involved does increase without bound. This is a consequence of a result by Westzynthius. In the opposite direction, the twin prime conjecture posits that g n = 2 {\displaystyle g_{n}=2} for infinitely many integers n {\displaystyle n} .
… excerpt ends here. Continue reading the full article.

