From Surf Wiki (app.surf) — the open knowledge base
Prime gap
Difference between two successive prime numbers
Difference between two successive prime numbers
A prime gap is the difference between two successive prime numbers. The n-th prime gap, denoted g_n or g(p_n) is the difference between the (n+1)th and the n-th prime numbers, i.e.,
: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, g_2 = g_3 = 2, 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, ... .
By the definition of g_n every prime can be written as
: 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 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 : 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. 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 \geq 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.
In the opposite direction, the twin prime conjecture posits that g_n=2 for infinitely many integers n.
Numerical results
Usually the ratio g_n / (\ln p_n) is called the merit of the gap g_n. Informally, the merit of a gap g_n can be thought of as the ratio of the size of the gap compared to the average prime gap sizes in the vicinity of p_n
The largest known prime gap with identified probable prime gap ends has length , with -digit probable primes and merit , found by Andreas Höglund in . The largest known prime gap with identified proven primes as gap ends has length and merit 25.90, with -digit primes found by P. Cami, M. Jansen and J. K. Andersen.
, the largest known merit value and first with merit over 40, as discovered by the Gapcoin network, is 41.93878373 with the 87-digit prime . The prime gap between it and the next prime is 8350.
| Merit | *gn* | digits | *pn* | Date | Discoverer |
|---|---|---|---|---|---|
| 87 | *see above* | 2017 | Gapcoin | ||
| 175 | × 409#/30 − 7016 | 2017 | Dana Jacobsen | ||
| 209 | 650094367}} × 491#/2310 − 8936 | 2017 | Dana Jacobsen | ||
| 404 | 100054841}} × 953#/210 − 9670 | 2020 | Seth Troisi | ||
| 97 | 512950801}} × 229#/5610 − 4138 | 2018 | Dana Jacobsen |
The Cramér–Shanks–Granville ratio is the ratio g_n / (\ln p_n)^2. 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. For comparison, the gap discovered by the Gapcoin network (whis Merit 41.938784), will only receive a value of 0.205879136 in this index. Other record terms can be found at .
We say that g_n is a maximal gap, if g_m for all m . , the largest known maximal prime gap has length 1724, found by Martin Raab, using code by Brian Kehrig. It is the 84th maximal prime gap, and it occurs after the prime 68068810283234182907. Other record (maximal) gap sizes can be found in , with the corresponding primes p_n in , and the values of n in . The sequence of maximal gaps up to the n-th prime is conjectured to have about 2 \ln n terms.
| # | *gn* | *pn* | *n* |
|---|---|---|---|
| 1 | 1 | 2 | 1 |
| 2 | 2 | 3 | 2 |
| 3 | 4 | 7 | 4 |
| 4 | 6 | 23 | 9 |
| 5 | 8 | 89 | 24 |
| 6 | 14 | 113 | 30 |
| 7 | 18 | 523 | 99 |
| 8 | 20 | 887 | 154 |
| 9 | 22 | 1,129 | 189 |
| 10 | 34 | 1,327 | 217 |
| 11 | 36 | 9,551 | 1,183 |
| 12 | 44 | 15,683 | 1,831 |
| 13 | 52 | 19,609 | 2,225 |
| 14 | 72 | 31,397 | 3,385 |
| 15 | 86 | 155,921 | 14,357 |
| 16 | 96 | 360,653 | 30,802 |
| 17 | 112 | 370,261 | 31,545 |
| 18 | 114 | 492,113 | 40,933 |
| 19 | 118 | 1,349,533 | 103,520 |
| 20 | 132 | 1,357,201 | 104,071 |
| 21 | 148 | 2,010,733 | 149,689 |
| 22 | 154 | 4,652,353 | 325,852 |
| 23 | 180 | 17,051,707 | 1,094,421 |
| 24 | 210 | 20,831,323 | 1,319,945 |
| 25 | 220 | 47,326,693 | 2,850,174 |
| 26 | 222 | 122,164,747 | 6,957,876 |
| 27 | 234 | 189,695,659 | 10,539,432 |
| 28 | 248 | 191,912,783 | 10,655,462 |
|
| # | *gn* | *pn* | *n* |
|---|---|---|---|
| 29 | 250 | 387,096,133 | 20,684,332 |
| 30 | 282 | 436,273,009 | 23,163,298 |
| 31 | 288 | 1,294,268,491 | 64,955,634 |
| 32 | 292 | 1,453,168,141 | 72,507,380 |
| 33 | 320 | 2,300,942,549 | 112,228,683 |
| 34 | 336 | 3,842,610,773 | 182,837,804 |
| 35 | 354 | 4,302,407,359 | 203,615,628 |
| 36 | 382 | 10,726,904,659 | 486,570,087 |
| 37 | 384 | 20,678,048,297 | 910,774,004 |
| 38 | 394 | 22,367,084,959 | 981,765,347 |
| 39 | 456 | 25,056,082,087 | 1,094,330,259 |
| 40 | 464 | 42,652,618,343 | 1,820,471,368 |
| 41 | 468 | 127,976,334,671 | 5,217,031,687 |
| 42 | 474 | 182,226,896,239 | 7,322,882,472 |
| 43 | 486 | 241,160,624,143 | 9,583,057,667 |
| 44 | 490 | 297,501,075,799 | 11,723,859,927 |
| 45 | 500 | 303,371,455,241 | 11,945,986,786 |
| 46 | 514 | 304,599,508,537 | 11,992,433,550 |
| 47 | 516 | 416,608,695,821 | 16,202,238,656 |
| 48 | 532 | 461,690,510,011 | 17,883,926,781 |
| 49 | 534 | 614,487,453,523 | 23,541,455,083 |
| 50 | 540 | 738,832,927,927 | 28,106,444,830 |
| 51 | 582 | 1,346,294,310,749 | 50,070,452,577 |
| 52 | 588 | 1,408,695,493,609 | 52,302,956,123 |
| 53 | 602 | 1,968,188,556,461 | 72,178,455,400 |
| 54 | 652 | 2,614,941,710,599 | 94,906,079,600 |
| 55 | 674 | 7,177,162,611,713 | 251,265,078,335 |
| 56 | 716 | 13,829,048,559,701 | 473,258,870,471 |
|
| # | *gn* | *pn* | *n* |
|---|---|---|---|
| 57 | 766 | 19,581,334,192,423 | 662,221,289,043 |
| 58 | 778 | 42,842,283,925,351 | 1,411,461,642,343 |
| 59 | 804 | 90,874,329,411,493 | 2,921,439,731,020 |
| 60 | 806 | 171,231,342,420,521 | 5,394,763,455,325 |
| 61 | 906 | 218,209,405,436,543 | 6,822,667,965,940 |
| 62 | 916 | 1,189,459,969,825,483 | 35,315,870,460,455 |
| 63 | 924 | 1,686,994,940,955,803 | 49,573,167,413,483 |
| 64 | 1,132 | 1,693,182,318,746,371 | 49,749,629,143,526 |
| 65 | 1,184 | 43,841,547,845,541,059 | 1,175,661,926,421,598 |
| 66 | 1,198 | 55,350,776,431,903,243 | 1,475,067,052,906,945 |
| 67 | 1,220 | 80,873,624,627,234,849 | 2,133,658,100,875,638 |
| 68 | 1,224 | 203,986,478,517,455,989 | 5,253,374,014,230,870 |
| 69 | 1,248 | 218,034,721,194,214,273 | 5,605,544,222,945,291 |
| 70 | 1,272 | 305,405,826,521,087,869 | 7,784,313,111,002,702 |
| 71 | 1,328 | 352,521,223,451,364,323 | 8,952,449,214,971,382 |
| 72 | 1,356 | 401,429,925,999,153,707 | 10,160,960,128,667,332 |
| 73 | 1,370 | 418,032,645,936,712,127 | 10,570,355,884,548,334 |
| 74 | 1,442 | 804,212,830,686,677,669 | 20,004,097,201,301,079 |
| 75 | 1,476 | 1,425,172,824,437,699,411 | 34,952,141,021,660,495 |
| 76 | 1,488 | 5,733,241,593,241,196,731 | 135,962,332,505,694,894 |
| 77 | 1,510 | 6,787,988,999,657,777,797 | 160,332,893,561,542,066 |
| 78 | 1,526 | 15,570,628,755,536,096,243 | 360,701,908,268,316,580 |
| 79 | 1,530 | 17,678,654,157,568,189,057 | 408,333,670,434,942,092 |
| 80 | 1,550 | 18,361,375,334,787,046,697 | 423,731,791,997,205,041 |
| 81 | 1,552 | 18,470,057,946,260,698,231 | 426,181,820,436,140,029 |
| 82 | 1,572 | 18,571,673,432,051,830,099 | 428,472,240,920,394,477 |
| 83 | 1,676 | 20,733,746,510,561,442,863 | 477,141,032,543,986,017 |
| 84 | 1,724 | 68,068,810,283,234,182,907 | 1,524,717,378,371,224,128 |
|}
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} , which means g_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 that the gaps get arbitrarily smaller in proportion to the primes: the quotient : \lim_{n\to\infty}\frac{g_n}{p_n}=0. In other words (by definition of a limit), for every \epsilon 0, there is a number N such that for all n N, : g_n .
Hoheisel (1930) was the first to show a sublinear dependence; that there exists a constant \theta such that : \pi(x + x^\theta) - \pi(x) \sim \frac{x^\theta}{\log x} \text{ as } x \to \infty, hence showing that : g_n \leqslant {p_n}^\theta for sufficiently large n.
Hoheisel obtained the possible value 32999/33000 for \theta. This was improved to 249/250 by Heilbronn, and to \theta = 3/4 + \epsilon, for any \epsilon 0, by Chudakov.
A major improvement is due to Ingham, who showed that for some positive constant c, : if \zeta(1/2 + it) = O(t^c) then \pi(x + x^\theta) - \pi(x) \sim \frac{x^\theta}{\log x} for any \theta (1 + 4c)/(2 + 4c).
Here, O refers to the big O notation, ζ denotes the Riemann zeta function and π the prime-counting function. Knowing that any c 1/6 is admissible, one obtains that θ may be any number greater than 5/8.
Since 5/8+ε n^{2/3}, it follows that there is always a prime number between n3 and (n + 1)3, if n is sufficiently large. In 2016, Dudek gave an explicit version of Ingham's result: there are primes between consecutive cubes for all n e^{e^{33.217}}\approx1.01\cdot10^{115809466034000}.
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 n2 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 .
A result, due to Baker, Harman and Pintz in 2001, shows that θ may be taken to be 0.525.
The above describes limits on all gaps; another area of interest is the minimum gap size. The twin prime conjecture asserts that there are always more gaps of size 2, but remains unproven. In 2005, Daniel Goldston, János Pintz and Cem Yıldırım proved that : \liminf_{n\to\infty}\frac{g_n}{\log p_n} = 0 and 2 years later improved this{{cite journal : \liminf_{n\to\infty}\frac{g_n}{\sqrt{\log p_n}(\log\log p_n)^2}
In 2013, Yitang Zhang proved that : \liminf_{n\to\infty} g_n
meaning that there are infinitely many gaps that do not exceed 70 million. A Polymath Project collaborative effort to optimize Zhang's bound managed to lower the bound to 4680 on July 20, 2013. In November 2013, James Maynard introduced a new refinement of the GPY sieve, allowing him to reduce the bound to 600 and also show that the gaps between primes m apart are bounded for all m. That is, for any m there exists a bound Δm such that p**n+m − pn ≤ Δm for infinitely many n. Using Maynard's ideas, the Polymath project improved the bound to 246; assuming the Elliott–Halberstam conjecture and its generalized form, the bound has been reduced to 12 and 6, respectively.
Lower bounds
In 1931, Erik Westzynthius proved that maximal prime gaps grow more than logarithmically. That is, : \limsup_{n\to\infty}\frac{g_n}{\log p_n}=\infty.
In 1938, Robert Rankin proved the existence of a constant c 0 such that the inequality : g_n \frac{c\ \log n\ \log\log n\ \log\log\log\log n}{(\log\log\log n)^2} 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 γ, where γ is the Euler–Mascheroni constant. The value of the constant c was improved in 1997 to any value less than 2e**γ.
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.{{cite book |editor1-last= Erdős |editor1-first= Paul |editor2-last= Bollobás |editor2-first= Béla |editor3-last= Thomason |editor3-first= Andrew |access-date= September 29, 2022 |archive-date= September 29, 2022 |archive-url= https://web.archive.org/web/20220929060157/https://books.google.com/books?id=1E6ZwSEtPAEC&pg=PA1 |url-status= live
The result was further improved to : g_n \frac{c\ \log n\ \log\log n\ \log\log\log\log n}{\log\log\log n} for infinitely many values of n by Ford–Green–Konyagin–Maynard–Tao.
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.
Lower bounds for chains of primes have also been determined.
Conjectures about gaps between primes
As described above, the best proven bound on gap sizes is g**n ≤ p**n0.525 (for n sufficiently large; we do not worry about 5 − 3 30.525 or 29 − 23 230.525), but it is observed that even maximal gaps are significantly smaller than that, leading to a plethora of unproven conjectures.
The first group hypothesize that the exponent can be reduced to .
Both Legendre's conjecture that there always exists a prime between consecutive perfect squares and Andrica's conjecture that the difference of square roots of consecutive primes is bounded by 1 imply that : g_n Oppermann's conjecture makes the stronger claim that, for sufficiently large n (probably n ≥ 31), : g_n
All of these remain unproved. Harald Cramér came close, proving that the Riemann hypothesis implies the gap gn satisfies : g_n = O(\sqrt{p_n} \log p_n), using the big O notation. (In fact this result needs only the weaker Lindelöf hypothesis, if one can tolerate an infinitesimally larger exponent.)
Dudek also proved an explicit version of Cramer's result (also assuming Riemann hypothesis) for all n ≥ 2, that is
g_n

In the same article, Cramér conjectured that the gaps are far smaller. Roughly speaking, Cramér's conjecture states that : g_n = O!\left((\log p_n)^2\right)!, a polylogarithmic growth rate slower than any exponent θ 0.
Cramér's model, under he made the conjecture, was oversimplified (assuming some events are statistically independent when they are dependent) and thus not very accurate (see Cramér's conjecture), but after further investigations, new heuristics were found which became strong evidence that conjecture is true.
As this matches the observed growth rate of prime gaps, there are a number of similar conjectures. Firoozbakht's conjecture is slightly stronger, stating that p**n1/n is a strictly decreasing function of n, i.e., : (p_{n+1})^{1/(n+1)}
If this conjecture were true, then g**n n)2 − log p**n − 1 for all n ≥ 10. It implies a strong form of Cramér's conjecture but is inconsistent with the heuristics of Granville and Pintz, which suggest that g**n (2 − ϵ)e−γ(log p**n)2 (1.1229 − ϵ)(log p**n)2 infinitely often for any ϵ 0, where γ denotes the Euler–Mascheroni constant.
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)th prime numbers is an example of an arithmetic function. In this context it is usually denoted d**n and called the prime difference function. The function is neither multiplicative nor additive.
References
References
- Westzynthius, E.. (1931). "Über die Verteilung der Zahlen die zu den n ersten Primzahlen teilerfremd sind". Commentationes Physico-Mathematicae Helsingsfors.
- ATH. (2024-03-11). "Announcement at Mersenneforum.org".
- "The Top-20 Prime Gaps".
- Andersen, Jens Kruse. (8 March 2013). "A megagap with merit 25.9".
- Nicely, Thomas R.. (2019). "NEW PRIME GAP OF MAXIMUM KNOWN MERIT".
- (June 11, 2022). "Prime Gap Records".
- "Record prime gap info".
- Nicely, Thomas R.. (2019). "TABLES OF PRIME GAPS".
- "Top 20 overall merits".
- Andersen, Jens Kruse. "Record prime gaps".
- (2020). "On the first occurrences of gaps between primes in a residue class". [[Journal of Integer Sequences]].
- Hoheisel, G.. (1930). "Primzahlprobleme in der Analysis". Sitzunsberichte der Königlich Preussischen Akademie der Wissenschaften zu Berlin.
- Heilbronn, H. A.. (1933). "Über den Primzahlsatz von Herrn Hoheisel". Mathematische Zeitschrift.
- Tchudakoff, N. G.. (1936). "On the difference between two neighboring prime numbers". Mat. Sb..
- Ingham, A. E.. (1937). "On the difference between consecutive primes". Quarterly Journal of Mathematics.
- Cheng, Yuan-You Fu-Rui. (2010). "Explicit estimate on primes between consecutive cubes". Rocky Mt. J. Math..
- Dudek, Adrian. (2014-01-17). "An Explicit Result for Primes Between Cubes".
- Huxley, M. N.. (1972). "On the Difference between Consecutive Primes". Inventiones Mathematicae.
- (2001). "The difference between consecutive primes, II". Proceedings of the London Mathematical Society.
- Zhang, Yitang. (2014). "Bounded gaps between primes". [[Annals of Mathematics]].
- "Bounded gaps between primes". Polymath.
- Maynard, James. (January 2015). "Small gaps between primes". [[Annals of Mathematics]].
- D.H.J. Polymath. (2014). "Variants of the Selberg sieve, and bounded intervals containing many primes". Research in the Mathematical Sciences.
- Pintz, J.. (1997). "Very large gaps between consecutive primes". [[Journal of Number Theory.
- (2016). "Large gaps between consecutive prime numbers". [[Ann. of Math.]].
- Maynard, James. (2016). "Large gaps between primes". [[Ann. of Math.]].
- (2018). "Long gaps between primes". [[J. Amer. Math. Soc.]].
- Tao, Terence. (16 December 2014). "Long gaps between primes / What's new".
- (2015-10-13). "Chains of large gaps between primes".
- Guy (2004) §A8
- Cramér, Harald. (1936). "On the order of magnitude of the difference between consecutive prime numbers". [[Acta Arithmetica]].
- Ingham, Albert E.. (1937). "On the difference between consecutive primes". Quarterly Journal of Mathematics.
- Sinha, Nilotpal Kanti. (2010). "On a new property of primes that leads to a generalization of Cramer's conjecture".
- Kourbatov, Alexei. (2015). "Upper bounds for prime gaps related to Firoozbakht's conjecture". Journal of Integer Sequences.
- Granville, Andrew. (1995). "Harald Cramér and the distribution of prime numbers". Scandinavian Actuarial Journal.
- Granville, Andrew. (1995). "Proceedings of the International Congress of Mathematicians".
- Pintz, János. (September 2007). "Cramér vs. Cramér: On Cramér's probabilistic model for primes". Functiones et Approximatio Commentarii Mathematici.
This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.
Ask Mako anything about Prime gap — get instant answers, deeper analysis, and related topics.
Research with MakoFree with your Surf account
Create a free account to save articles, ask Mako questions, and organize your research.
Sign up freeThis content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.
Report