Prime gap
A prime gap is the difference between two successive prime numbers. The nth prime gap, denoted g_{n} or g(p_{n}) is the difference between the (n + 1)st and the nth prime numbers, i.e.
 [math]\displaystyle{ g_n = p_{n + 1}  p_n.\ }[/math]
We have g_{1} = 1, g_{2} = g_{3} = 2, and g_{4} = 4. The sequence (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} every prime can be written as
 [math]\displaystyle{ p_{n+1} = 2 + \sum_{i=1}^n g_i. }[/math]
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} and g_{3} between the primes 3, 5, and 7.
For any integer n, the factorial n! is the product of all positive integers up to and including n. Then in the sequence
 [math]\displaystyle{ n!+2,\; n!+3,\; \ldots,\; n!+n }[/math]
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. It follows that there are gaps between primes that are arbitrarily large, that is, for any integer N, there is an integer m with g_{m} ≥ N.
However, prime gaps of n numbers can occur at numbers much smaller than 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 1307674368000.
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 to be 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.^{[2]}
In the opposite direction, the twin prime conjecture posits that g_{n} = 2 for infinitely many integers n.
Numerical results
Usually the ratio of [math]\displaystyle{ \frac{g_n}{\ln(p_n)} }[/math] is called the merit of the gap g_{n}. (As of April 2022), the largest known prime gap with identified probable prime gap ends has length 7186572, with 208095digit probable primes and merit M = 14.9985, found by Michiel Jansen using a sieve program developed by J. K. Andersen.^{[3]}^{[4]} The largest known prime gap with identified proven primes as gap ends has length 1113106 and merit 25.90, with 18662digit primes found by P. Cami, M. Jansen and J. K. Andersen.^{[5]}^{[6]}
(As of September 2022), the largest known merit value and first with merit over 40, as discovered by the Gapcoin network, is 41.93878373 with the 87digit prime 293703234068022590158723766104419463425709075574811762098588798217895728858676728143227. The prime gap between it and the next prime is 8350.^{[7]}^{[8]}
Merit  g_{n}  digits  p_{n}  Date  Discoverer 

41.938784  8350  87  see above  2017  Gapcoin 
39.620154  15900  175  3483347771 × 409#/ 30 − 7016  2017  Dana Jacobsen 
38.066960  18306  209  650094367 × 491#/2310 − 8936  2017  Dana Jacobsen 
38.047893  35308  404  100054841 × 953#/ 210 − 9670  2020  Seth Troisi 
37.824126  8382  97  512950801 × 229#/5610 − 4138  2018  Dana Jacobsen 
The Cramér–Shanks–Granville ratio is the ratio of g_{n} / (ln(p_{n}))^{2}.^{[7]} If we discard anomalously high values of the ratio for the primes 2, 3, 7, then the greatest known value of this ratio is 0.9206386 for the prime 1693182318746371. Other record terms can be found at OEIS: A111943.
We say that g_{n} is a maximal gap, if g_{m} < g_{n} for all m < n. (As of December 2023), the largest known maximal prime gap has length 1552, found by Craig Loizides. It is the 81st maximal prime gap, and it occurs after the prime 18470057946260698231.^{[12]} Other record (maximal) gap sizes can be found in OEIS: A005250, with the corresponding primes p_{n} in OEIS: A002386, and the values of n in OEIS: A005669. The sequence of maximal gaps up to the nth prime is conjectured to have about [math]\displaystyle{ 2\ln n }[/math] terms^{[13]} (see table below).



Further results
Upper bounds
Bertrand's postulate, proven in 1852, states that there is always a prime number between k and 2k, so in particular p_{n +1} < 2p_{n}, which means g_{n} < p_{n} .
The prime number theorem, proven in 1896, says that the average length of the gap between a prime p and the next prime will asymptotically approach ln(p), the natural logarithm of p, for sufficiently large primes. The actual length of the gap might be much more or less than this. However, one can deduce from the prime number theorem an upper bound on the length of prime gaps:
For every [math]\displaystyle{ \epsilon \gt 0 }[/math], there is a number [math]\displaystyle{ N }[/math] such that for all [math]\displaystyle{ n \gt N }[/math]
 [math]\displaystyle{ g_n \lt p_n\epsilon }[/math].
One can also deduce that the gaps get arbitrarily smaller in proportion to the primes: the quotient
 [math]\displaystyle{ \lim_{n\to\infty}\frac{g_n}{p_n}=0. }[/math]
Hoheisel (1930) was the first to show^{[14]} that there exists a constant θ < 1 such that
 [math]\displaystyle{ \pi(x + x^\theta)  \pi(x) \sim \frac{x^\theta}{\log(x)} \text{ as } x \to \infty, }[/math]
hence showing that
 [math]\displaystyle{ g_n \lt p_n^\theta,\, }[/math]
for sufficiently large n.
Hoheisel obtained the possible value 32999/33000 for θ. This was improved to 249/250 by Heilbronn,^{[15]} and to θ = 3/4 + ε, for any ε > 0, by Chudakov.^{[16]}
A major improvement is due to Ingham,^{[17]} who showed that for some positive constant c,
 if [math]\displaystyle{ \zeta(1/2 + it) = O(t^c) }[/math] then [math]\displaystyle{ \pi(x + x^\theta)  \pi(x) \sim \frac{x^\theta}{\log(x)} }[/math] for any [math]\displaystyle{ \theta \gt (1 + 4c)/(2 + 4c). }[/math]
Here, O refers to the big O notation, ζ denotes the Riemann zeta function and π the primecounting function. Knowing that any c > 1/6 is admissible, one obtains that θ may be any number greater than 5/8.
An immediate consequence of Ingham's result is that there is always a prime number between n^{3} and (n + 1)^{3}, if n is sufficiently large.^{[18]} The Lindelöf hypothesis would imply that Ingham's formula holds for c any positive number: but even this would not be enough to imply that there is a prime number between n^{2} and (n + 1)^{2} for n sufficiently large (see Legendre's conjecture). To verify this, a stronger result such as Cramér's conjecture would be needed.
Huxley in 1972 showed that one may choose θ = 7/12 = 0.58(3).^{[19]}
A result, due to Baker, Harman and Pintz in 2001, shows that θ may be taken to be 0.525.^{[20]}
In 2005, Daniel Goldston, János Pintz and Cem Yıldırım proved that
 [math]\displaystyle{ \liminf_{n\to\infty}\frac{g_n}{\log p_n} = 0 }[/math]
and 2 years later improved this^{[21]} to
 [math]\displaystyle{ \liminf_{n\to\infty}\frac{g_n}{\sqrt{\log p_n}(\log\log p_n)^2}\lt \infty. }[/math]
In 2013, Yitang Zhang proved that
 [math]\displaystyle{ \liminf_{n\to\infty} g_n \lt 7\cdot 10^7, }[/math]
meaning that there are infinitely many gaps that do not exceed 70 million.^{[22]} A Polymath Project collaborative effort to optimize Zhang's bound managed to lower the bound to 4680 on July 20, 2013.^{[23]} In November 2013, James Maynard introduced a new refinement of the GPY sieve, allowing him to reduce the bound to 600 and show that for any m there exists a bounded interval with an infinite number of translations each of which containing m prime numbers.^{[24]} Using Maynard's ideas, the Polymath project improved the bound to 246;^{[23]}^{[25]} assuming the Elliott–Halberstam conjecture and its generalized form, the bound has been reduced to 12 and 6, respectively.^{[23]}
Lower bounds
In 1931, Erik Westzynthius proved that maximal prime gaps grow more than logarithmically. That is,^{[2]}
 [math]\displaystyle{ \limsup_{n\to\infty}\frac{g_n}{\log p_n}=\infty. }[/math]
In 1938, Robert Rankin proved the existence of a constant c > 0 such that the inequality
 [math]\displaystyle{ g_n \gt \frac{c\ \log n\ \log\log n\ \log\log\log\log n}{(\log\log\log n)^2} }[/math]
holds for infinitely many values of n, improving the results of Westzynthius and Paul Erdős. He later showed that one can take any constant c < e^{γ}, where γ is the Euler–Mascheroni constant. The value of the constant c was improved in 1997 to any value less than 2e^{γ}.^{[26]}
Paul Erdős offered a $10,000 prize for a proof or disproof that the constant c in the above inequality may be taken arbitrarily large.^{[27]} This was proved to be correct in 2014 by Ford–Green–Konyagin–Tao and, independently, James Maynard.^{[28]}^{[29]}
The result was further improved to
 [math]\displaystyle{ g_n \gt \frac{c\ \log n\ \log\log n\ \log\log\log\log n}{\log\log\log n} }[/math]
for infinitely many values of n by Ford–Green–Konyagin–Maynard–Tao.^{[30]}
In the spirit of Erdős' original prize, Terence Tao offered US$10,000 for a proof that c may be taken arbitrarily large in this inequality.^{[31]}
Lower bounds for chains of primes have also been determined.^{[32]}
Conjectures about gaps between primes
Even better results are possible under the Riemann hypothesis. Harald Cramér proved^{[33]} that the Riemann hypothesis implies the gap g_{n} satisfies
 [math]\displaystyle{ g_n = O(\sqrt{p_n} \log p_n), }[/math]
using the big O notation. (In fact this result needs only the weaker Lindelöf hypothesis, if one can tolerate an infinitesimally larger exponent.^{[34]}) Later, he conjectured that the gaps are even smaller. Roughly speaking, Cramér's conjecture states that
 [math]\displaystyle{ g_n = O\!\left((\log p_n)^2\right)\!. }[/math]
Firoozbakht's conjecture states that [math]\displaystyle{ p_{n}^{1/n}\! }[/math] (where [math]\displaystyle{ p_n }[/math] is the nth prime) is a strictly decreasing function of n, i.e.,
 [math]\displaystyle{ p_{n+1}^{1/(n+1)} \!\lt p_n^{1/n} \text{ for all } n \ge 1. }[/math]
If this conjecture is true, then the function [math]\displaystyle{ g_n = p_{n+1}  p_n }[/math] satisfies [math]\displaystyle{ g_n \lt (\log p_n)^2  \log p_n \text{ for all } n \gt 4. }[/math]^{[35]} It implies a strong form of Cramér's conjecture but is inconsistent with the heuristics of Granville and Pintz^{[36]}^{[37]}^{[38]} which suggest that [math]\displaystyle{ g_n \gt \frac{2\varepsilon}{e^\gamma}(\log p_n)^2 }[/math] infinitely often for any [math]\displaystyle{ \varepsilon\gt 0, }[/math] where [math]\displaystyle{ \gamma }[/math] denotes the Euler–Mascheroni constant.
Meanwhile, Oppermann's conjecture is weaker than Cramér's conjecture. The expected gap size with Oppermann's conjecture is on the order of
 [math]\displaystyle{ g_n \lt \sqrt{p_n}. }[/math]
As a result, under Oppermann's conjecture there exists [math]\displaystyle{ m }[/math] (probably [math]\displaystyle{ m=30 }[/math]) for which every natural number [math]\displaystyle{ n \gt m }[/math] satisfies [math]\displaystyle{ g_n \lt \sqrt{p_n}. }[/math]
Andrica's conjecture, which is a weaker conjecture than Oppermann's, states that^{[39]}
 [math]\displaystyle{ g_n \lt 2\sqrt{p_n} + 1. }[/math]
This is a slight strengthening of Legendre's conjecture that between successive square numbers there is always a prime.
Polignac's conjecture states that every positive even number k occurs as a prime gap infinitely often. The case k = 2 is the twin prime conjecture. The conjecture has not yet been proven or disproven for any specific value of k, but the improvements on Zhang's result discussed above prove that it is true for at least one (currently unknown) value of k ≤ 246.
As an arithmetic function
The gap g_{n} between the nth and (n + 1)st prime numbers is an example of an arithmetic function. In this context it is usually denoted d_{n} and called the prime difference function.^{[39]} The function is neither multiplicative nor additive.
See also
References
 ↑ Ares, Saul; Castro, Mario (1 February 2006). "Hidden structure in the randomness of the prime number sequence?". Physica A: Statistical Mechanics and Its Applications 360 (2): 285–296. doi:10.1016/j.physa.2005.06.066.
 ↑ ^{2.0} ^{2.1} Westzynthius, E. (1931), "Über die Verteilung der Zahlen die zu den n ersten Primzahlen teilerfremd sind" (in de), Commentationes PhysicoMathematicae Helsingsfors 5: 1–37.
 ↑ MJansen (20220416). "Announcement at Mersenneforum.org". https://mersenneforum.org/showpost.php?p=604047&postcount=88.
 ↑ mart_r (20220714). "Verification Announcement at Mersenneforum.org". https://mersenneforum.org/showpost.php?p=609513&postcount=114.
 ↑ Andersen, Jens Kruse. "The Top20 Prime Gaps". http://primerecords.dk/primegaps/gaps20.htm.
 ↑ Andersen, Jens Kruse (8 March 2013). "A megagap with merit 25.9". http://primerecords.dk/primegaps/gap1113106.htm.
 ↑ ^{7.0} ^{7.1} ^{7.2} Nicely, Thomas R. (2019). "NEW PRIME GAP OF MAXIMUM KNOWN MERIT". https://faculty.lynchburg.edu/~nicely/#MaxMerit.
 ↑ "Prime Gap Records". June 11, 2022. https://github.com/primegaplistproject/primegaplist.
 ↑ "Record prime gap info". http://ntheory.org/gaps/stats.pl.
 ↑ Nicely, Thomas R. (2019). "TABLES OF PRIME GAPS". https://faculty.lynchburg.edu/~nicely/index.html#TPG.
 ↑ "Top 20 overall merits". https://primegaplistproject.github.io/lists/top20overallmerits/.
 ↑ Andersen, Jens Kruse. "Record prime gaps". https://www.pzktupel.de/JensKruseAndersen/risinggap.php.
 ↑ Kourbatov, A.; Wolf, M. (2020). "On the first occurrences of gaps between primes in a residue class". Journal of Integer Sequences 23 (Article 20.9.3). https://cs.uwaterloo.ca/journals/JIS/VOL23/Wolf/wolf2.html. Retrieved December 3, 2020.
 ↑ Hoheisel, G. (1930). "Primzahlprobleme in der Analysis". Sitzunsberichte der Königlich Preussischen Akademie der Wissenschaften zu Berlin 33: 3–11.
 ↑ Heilbronn, H. A. (1933). "Über den Primzahlsatz von Herrn Hoheisel". Mathematische Zeitschrift 36 (1): 394–423. doi:10.1007/BF01188631.
 ↑ Tchudakoff, N. G. (1936). "On the difference between two neighboring prime numbers". Mat. Sb. 1: 799–814.
 ↑ Ingham, A. E. (1937). "On the difference between consecutive primes". Quarterly Journal of Mathematics. Oxford Series 8 (1): 255–266. doi:10.1093/qmath/os8.1.255. Bibcode: 1937QJMat...8..255I.
 ↑ Cheng, YuanYou FuRui (2010). "Explicit estimate on primes between consecutive cubes". Rocky Mt. J. Math. 40: 117–153. doi:10.1216/rmj2010401117.
 ↑ Huxley, M. N. (1972). "On the Difference between Consecutive Primes". Inventiones Mathematicae 15 (2): 164–170. doi:10.1007/BF01418933. Bibcode: 1971InMat..15..164H.
 ↑ Baker, R. C.; Harman, G.; Pintz, J. (2001). "The difference between consecutive primes, II". Proceedings of the London Mathematical Society 83 (3): 532–562. doi:10.1112/plms/83.3.532.
 ↑ Goldston, Daniel A.; Pintz, János; Yıldırım, Cem Yalçin (2010). "Primes in Tuples II". Acta Mathematica 204 (1): 1–47. doi:10.1007/s1151101000449.
 ↑ Zhang, Yitang (2014). "Bounded gaps between primes". Annals of Mathematics 179 (3): 1121–1174. doi:10.4007/annals.2014.179.3.7.
 ↑ ^{23.0} ^{23.1} ^{23.2} "Bounded gaps between primes". Polymath. http://michaelnielsen.org/polymath1/index.php?title=Bounded_gaps_between_primes.
 ↑ Maynard, James (2015). "Small gaps between primes". Annals of Mathematics 181 (1): 383–413. doi:10.4007/annals.2015.181.1.7.
 ↑ D.H.J. Polymath (2014). "Variants of the Selberg sieve, and bounded intervals containing many primes". Research in the Mathematical Sciences 1 (12). doi:10.1186/s4068701400127.
 ↑ Pintz, J. (1997). "Very large gaps between consecutive primes". J. Number Theory 63 (2): 286–301. doi:10.1006/jnth.1997.2081.
 ↑ Erdős, Paul; Bollobás, Béla; Thomason, Andrew, eds (1997). Combinatorics, Geometry and Probability: A Tribute to Paul Erdös. Cambridge University Press. p. 1. ISBN 9780521584722. https://books.google.com/books?id=1E6ZwSEtPAEC&pg=PA1. Retrieved September 29, 2022.
 ↑ Ford, Kevin; Green, Ben; Konyagin, Sergei; Tao, Terence (2016). "Large gaps between consecutive prime numbers". Ann. of Math. 183 (3): 935–974. doi:10.4007/annals.2016.183.3.4.
 ↑ Maynard, James (2016). "Large gaps between primes". Ann. of Math. 183 (3): 915–933. doi:10.4007/annals.2016.183.3.3.
 ↑ Ford, Kevin; Green, Ben; Konyagin, Sergei; Maynard, James; Tao, Terence (2018). "Long gaps between primes". J. Amer. Math. Soc. 31 (1): 65–105. doi:10.1090/jams/876.
 ↑ Tao, Terence (16 December 2014). "Long gaps between primes / What's new". https://terrytao.wordpress.com/2014/12/16/longgapsbetweenprimes/.
 ↑ Ford, Kevin; Maynard, James; Tao, Terence (20151013). "Chains of large gaps between primes". arXiv:1511.04468 [math.NT].
 ↑ Cramér, Harald (1936). "On the order of magnitude of the difference between consecutive prime numbers". Acta Arithmetica 2: 23–46. doi:10.4064/aa212346.
 ↑ Ingham, Albert E. (1937). "On the difference between consecutive primes". Quart. J. Math. (Oxford) 8 (1): 255–266. doi:10.1093/qmath/os8.1.255. https://dustri.org/b/files/On_the_difference_between_consecutive_primes__A.E.Ingham.pdf.
 ↑ Sinha, Nilotpal Kanti (2010). "On a new property of primes that leads to a generalization of Cramer's conjecture". arXiv:1010.1399 [math.NT]..
 ↑ Granville, Andrew (1995). "Harald Cramér and the distribution of prime numbers". Scandinavian Actuarial Journal 1: 12–28. doi:10.1080/03461238.1995.10413946. http://www.dartmouth.edu/~chance/chance_news/for_chance_news/Riemann/cramer.pdf. Retrieved March 2, 2016..
 ↑ Granville, Andrew (1995). "Unexpected Irregularities in the Distribution of Prime Numbers". Proceedings of the International Congress of Mathematicians. 1. pp. 388–399. doi:10.1007/9783034890786_32. ISBN 9783034898973. http://www.dms.umontreal.ca/~andrew/PDF/icm.pdf. Retrieved March 2, 2016..
 ↑ Pintz, János (September 2007). "Cramér vs. Cramér: On Cramér's probabilistic model for primes". Functiones et Approximatio Commentarii Mathematici 37 (2): 232–471. doi:10.7169/facm/1229619660.
 ↑ ^{39.0} ^{39.1} Guy (2004) §A8
 Guy, Richard K. (2004). Unsolved problems in number theory (3rd ed.). SpringerVerlag. ISBN 9780387208602.
Further reading
 Soundararajan, Kannan (2007). "Small gaps between prime numbers: the work of GoldstonPintzYıldırım". Bull. Am. Math. Soc.. New Series 44 (1): 1–18. doi:10.1090/s0273097906011426.
 Mihăilescu, Preda (June 2014). "On some conjectures in additive number theory". EMS Newsletter (92): 13–16. doi:10.4171/NEWS. ISSN 1027488X. http://www.emsph.org/journals/newsletter/pdf/20140692.pdf.
External links
 Thomas R. Nicely, Some Results of Computational Research in Prime Numbers  Computational Number Theory. This reference web site includes a list of all first known occurrence prime gaps.
 Weisstein, Eric W.. "Prime Difference Function". http://mathworld.wolfram.com/PrimeDifferenceFunction.html.
 "Prime Difference Function". http://planetmath.org/?op=getobj&from=objects&id={{{id}}}.
 Armin Shams, Reextending Chebyshev's theorem about Bertrand's conjecture, does not involve an 'arbitrarily big' constant as some other reported results.
 Chris Caldwell, Gaps Between Primes; an elementary introduction
 Andrew Granville, Primes in Intervals of Bounded Length; overview of the results obtained so far up to and including James Maynard's work of November 2013.
Original source: https://en.wikipedia.org/wiki/Prime gap.
Read more 