# Prime gap

A prime gap is the difference between two successive prime numbers. The n-th prime gap, denoted gn or g(pn) is the difference between the (n + 1)-th and the n-th prime numbers, i.e.

${\displaystyle g_{n}=p_{n+1}-p_{n}.\ }$

We have g1 = 1, g2 = g3 = 2, and g4 = 4. The sequence (gn) 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 gn every prime can be written as

${\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 g2 and g3 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

${\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. It follows that there are gaps between primes that are arbitrarily large, that is, for any integer N, there is an integer m with gmN.

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 the integer, and therefore the ratio of the prime gap to the integers 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 ek; 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 gn = 2 for infinitely many integers n.

## Numerical results

Usually the ratio of gn / ln(pn) is called the merit of the gap gn . As of September 2017, the largest known prime gap with identified probable prime gap ends has length 6582144, with 216841-digit probable primes found by Martin Raab.[3] This gap has merit M = 13.1829. The largest known prime gap with identified proven primes as gap ends has length 1113106 and merit 25.90, with 18662-digit primes found by P. Cami, M. Jansen and J. K. Andersen.[4][5]

As of December 2017, 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 293703234068022590158723766104419463425709075574811762098588798217895728858676728143227. The prime gap between it and the next prime is 8350.[6]

Largest known merit values (as of January 2018)[6][7][8]
MeritgndigitspnDateDiscoverer
41.938784835087See above2017Gapcoin
39.620154159001753483347771 × 409#/30 − 70162017Dana Jacobsen
38.06696018306209650094367 × 491#/2310 − 89362017Dana Jacobsen
37.824126838297512950801 × 229#/5610 − 41382018Dana Jacobsen
37.005294260543061780005161 × 719#/30 − 177682017Dana Jacobsen

The Cramér–Shanks–Granville ratio is the ratio of gn / (ln(pn))2.[6] 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 .

We say that gn is a maximal gap, if gm < gn for all m < n. As of August 2018 the largest known maximal prime gap has length 1550, found by Bertil Nyman. It is the 80th maximal gap, and it occurs after the prime 18361375334787046697.[9] Other record (maximal) gap sizes can be found in , with the corresponding primes pn in , and the values of n in .

The 80 known maximal prime gaps
Number 1 to 27
#gnpnn
1121
2232
3474
46239
588924
61411330
71852399
820887154
9221,129189
10341,327217
11369,5511,183
124415,6831,831
135219,6092,225
147231,3973,385
1586155,92114,357
1696360,65330,802
17112370,26131,545
18114492,11340,933
191181,349,533103,520
201321,357,201104,071
211482,010,733149,689
221544,652,353325,852
2318017,051,7071,094,421
2421020,831,3231,319,945
2522047,326,6932,850,174
26222122,164,7476,957,876
27234189,695,65910,539,432
Number 28 to 54
#gnpnn
28248191,912,78310,655,462
29250387,096,13320,684,332
30282436,273,00923,163,298
312881,294,268,49164,955,634
322921,453,168,14172,507,380
333202,300,942,549112,228,683
343363,842,610,773182,837,804
353544,302,407,359203,615,628
3638210,726,904,659486,570,087
3738420,678,048,297910,774,004
3839422,367,084,959981,765,347
3945625,056,082,0871,094,330,259
4046442,652,618,3431,820,471,368
41468127,976,334,6715,217,031,687
42474182,226,896,2397,322,882,472
43486241,160,624,1439,583,057,667
44490297,501,075,79911,723,859,927
45500303,371,455,24111,945,986,786
46514304,599,508,53711,992,433,550
47516416,608,695,82116,202,238,656
48532461,690,510,01117,883,926,781
49534614,487,453,52323,541,455,083
50540738,832,927,92728,106,444,830
515821,346,294,310,74950,070,452,577
525881,408,695,493,60952,302,956,123
536021,968,188,556,46172,178,455,400
546522,614,941,710,59994,906,079,600
Number 55 to 80
#gnpnn
556747,177,162,611,713251,265,078,335
5671613,829,048,559,701473,258,870,471
5776619,581,334,192,423662,221,289,043
5877842,842,283,925,3511,411,461,642,343
5980490,874,329,411,4932,921,439,731,020
60806171,231,342,420,5215,394,763,455,325
61906218,209,405,436,5436,822,667,965,940
629161,189,459,969,825,48335,315,870,460,455
639241,686,994,940,955,80349,573,167,413,483
641,1321,693,182,318,746,37149,749,629,143,526
651,18443,841,547,845,541,0591,175,661,926,421,598
661,19855,350,776,431,903,2431,475,067,052,906,945
671,22080,873,624,627,234,8492,133,658,100,875,638
681,224203,986,478,517,455,9895,253,374,014,230,870
691,248218,034,721,194,214,2735,605,544,222,945,291
701,272305,405,826,521,087,8697,784,313,111,002,702
711,328352,521,223,451,364,3238,952,449,214,971,382
721,356401,429,925,999,153,70710,160,960,128,667,332
731,370418,032,645,936,712,12710,570,355,884,548,334
741,442804,212,830,686,677,66920,004,097,201,301,079
751,4761,425,172,824,437,699,41134,952,141,021,660,495
761,4885,733,241,593,241,196,731135,962,332,505,694,894
771,5106,787,988,999,657,777,797160,332,893,561,542,066
781,52615,570,628,755,536,096,243360,701,908,268,316,580
791,53017,678,654,157,568,189,057408,333,670,434,942,092
801,55018,361,375,334,787,046,697423,731,791,997,205,041

## 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 pn+1 < 2pn, which means gn < pn.

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) 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 ${\displaystyle \epsilon >0}$, there is a number ${\displaystyle N}$ such that for all ${\displaystyle n>N}$

${\displaystyle g_{n}.

One can also deduce that the gaps get arbitrarily smaller in proportion to the primes: the quotient

${\displaystyle \lim _{n\to \infty }{\frac {g_{n}}{p_{n}}}=0.}$

Hoheisel (1930) was the first to show[10] that there exists a constant θ < 1 such that

${\displaystyle \pi (x+x^{\theta })-\pi (x)\sim {\frac {x^{\theta }}{\log(x)}}{\text{ as }}x\to \infty ,}$

hence showing that

${\displaystyle g_{n}

for sufficiently large n.

Hoheisel obtained the possible value 32999/33000 for θ. This was improved to 249/250 by Heilbronn,[11] and to θ = 3/4 + ε, for any ε > 0, by Chudakov.[12]

A major improvement is due to Ingham,[13] who showed that for some positive constant c, if

${\displaystyle \zeta (1/2+it)=O(t^{c})\,}$ then ${\displaystyle \pi (x+x^{\theta })-\pi (x)\sim {\frac {x^{\theta }}{\log(x)}}}$ for any ${\displaystyle \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.

An immediate consequence of Ingham's result is that there is always a prime number between n3 and (n + 1)3, if n is sufficiently large.[14] 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 θ = 7/12 = 0.58(3).[15]

A result, due to Baker, Harman and Pintz in 2001, shows that θ may be taken to be 0.525.[16]

In 2005, Daniel Goldston, János Pintz and Cem Yıldırım proved that

${\displaystyle \liminf _{n\to \infty }{\frac {g_{n}}{\log p_{n}}}=0}$

and 2 years later improved this[17] to

${\displaystyle \liminf _{n\to \infty }{\frac {g_{n}}{{\sqrt {\log p_{n}}}(\log \log p_{n})^{2}}}<\infty .}$

In 2013, Yitang Zhang proved that

${\displaystyle \liminf _{n\to \infty }g_{n}<7\cdot 10^{7},}$

meaning that there are infinitely many gaps that do not exceed 70 million.[18] A Polymath Project collaborative effort to optimize Zhang’s bound managed to lower the bound to 4680 on July 20, 2013.[19] 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.[20] Using Maynard's ideas, the Polymath project improved the bound to 246;[19][21] assuming the Elliott–Halberstam conjecture and its generalized form, N has been reduced to 12 and 6, respectively.[19]

### Lower bounds

In 1931, Erik Westzynthius proved that maximal prime gaps grow more than logarithmically. That is,[2]

${\displaystyle \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

${\displaystyle g_{n}>{\frac {c\log n\log \log n\log \log \log \log n}{(\log \log \log n)^{2}}}}$

holds for infinitely many values 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γ.[22]

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.[23] This was proved to be correct in 2014 by Ford–Green–Konyagin–Tao and, independently, James Maynard.[24][25]

The result was further improved to

${\displaystyle 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.[26]

In the spirit of Erdös original prize, Terence Tao offered 10,000 USD for a proof that c may be taken arbitrarily large in this inequality.[27]

Lower bounds for chains of primes have also been determined.[28]

## Conjectures about gaps between primes

Even better results are possible under the Riemann hypothesis. Harald Cramér proved[29] that the Riemann hypothesis implies the gap gn satisfies

${\displaystyle g_{n}=O({\sqrt {p_{n}}}\log p_{n}),}$

using the big O notation. Later, he conjectured that the gaps are even smaller. Roughly speaking, Cramér's conjecture states that

${\displaystyle g_{n}=O\left((\log p_{n})^{2}\right).}$

Firoozbakht's conjecture states that ${\displaystyle p_{n}^{1/n}}$ (where ${\displaystyle p_{n}}$ is the nth prime) is a strictly decreasing function of n, i.e.,

${\displaystyle p_{n+1}^{1/(n+1)}

If this conjecture is true, then the function ${\displaystyle g_{n}=p_{n+1}-p_{n}}$ satisfies ${\displaystyle g_{n}<(\log p_{n})^{2}-\log p_{n}{\text{ for all }}n>4.}$[30] It implies a strong form of Cramér's conjecture but is inconsistent with the heuristics of Granville and Pintz[31][32][33] which suggest that ${\displaystyle g_{n}>{\frac {2-\varepsilon }{e^{\gamma }}}(\log p_{n})^{2}}$ infinitely often for any ${\displaystyle \varepsilon >0,}$ where ${\displaystyle \gamma }$ 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

${\displaystyle g_{n}<{\sqrt {p_{n}}}.}$

As a result, under Oppermann's conjecture – there exists ${\displaystyle m}$ (probably ${\displaystyle m=30}$) for which every natural ${\displaystyle n>m}$ satisfies ${\displaystyle g_{n}<{\sqrt {p_{n}}}.}$

Andrica's conjecture, which is a weaker conjecture than Oppermann's, states that[34]

${\displaystyle g_{n}<2{\sqrt {p_{n}}}+1.}$

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 Zhang Yitang's result proves that it is true for at least one (currently unknown) value of k which is smaller than 70,000,000; as discussed above, this has been improved to 246.

## As an arithmetic function

The gap gn between the nth and (n + 1)st prime numbers is an example of an arithmetic function. In this context it is usually denoted dn and called the prime difference function.[34] The function is neither multiplicative nor additive.

## References

1. "Hidden structure in the randomness of the prime number sequence?", S. Ares & M. Castro, 2005
2. Westzynthius, E. (1931), "Über die Verteilung der Zahlen die zu den n ersten Primzahlen teilerfremd sind", Commentationes Physico-Mathematicae Helsingsfors (in German), 5: 1–37, JFM 57.0186.02, Zbl 0003.24601.
4. Andersen, Jens Kruse. "The Top-20 Prime Gaps". Retrieved 2014-06-13.
5. A proven prime gap of 1113106
6. NEW PRIME GAP OF MAXIMUM KNOWN MERIT
7. Dynamic prime gap statistics
8. TABLES OF PRIME GAPS
9. NEW MAXIMAL PRIME GAPS OF 1530 AND 1550
10. Hoheisel, G. (1930). "Primzahlprobleme in der Analysis". Sitzunsberichte der Königlich Preussischen Akademie der Wissenschaften zu Berlin. 33: 3–11. JFM 56.0172.02.
11. Heilbronn, H. A. (1933). "Über den Primzahlsatz von Herrn Hoheisel". Mathematische Zeitschrift. 36 (1): 394–423. doi:10.1007/BF01188631.
12. Tchudakoff, N. G. (1936). "On the difference between two neighboring prime numbers". Mat. Sb. 1: 799–814.
13. Ingham, A. E. (1937). "On the difference between consecutive primes". Quarterly Journal of Mathematics. Oxford Series. 8 (1): 255–266. Bibcode:1937QJMat...8..255I. doi:10.1093/qmath/os-8.1.255.
14. Cheng, Yuan-You Fu-Rui (2010). "Explicit estimate on primes between consecutive cubes". Rocky Mt. J. Math. 40: 117–153. arXiv:0810.2113. doi:10.1216/rmj-2010-40-1-117. Zbl 1201.11111.
15. Huxley, M. N. (1972). "On the Difference between Consecutive Primes". Inventiones Mathematicae. 15 (2): 164–170. Bibcode:1971InMat..15..164H. doi:10.1007/BF01418933.
16. 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.
17. Goldston, D. A.; Pintz, J.; Yildirim, C. Y. (2007). "Primes in Tuples II". arXiv:0710.2728 [math.NT].
18. Zhang, Yitang (2014). "Bounded gaps between primes". Annals of Mathematics. 179 (3): 1121–1174. doi:10.4007/annals.2014.179.3.7. MR 3171761.
19. "Bounded gaps between primes". Polymath. Retrieved 2013-07-21.
20. Maynard, James (2015). "Small gaps between primes". Annals of Mathematics. 181 (1): 383–413. arXiv:1311.4600. doi:10.4007/annals.2015.181.1.7. MR 3272929.
21. D.H.J. Polymath (2014). "Variants of the Selberg sieve, and bounded intervals containing many primes". Research in the Mathematical Sciences. 1 (12). arXiv:1407.4897. doi:10.1186/s40687-014-0012-7. MR 3373710.
22. Pintz, J. (1997). "Very large gaps between consecutive primes". J. Number Theory. 63 (2): 286–301. doi:10.1006/jnth.1997.2081.
23. 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.
24. Ford, Kevin; Green, Ben; Konyagin, Sergei; Tao, Terence (2016). "Large gaps between consecutive prime numbers". Ann. of Math. 183 (3): 935–974. arXiv:1408.4505. doi:10.4007/annals.2016.183.3.4. MR 3488740.
25. Maynard, James (2016). "Large gaps between primes". Ann. of Math. 183 (3): 915–933. arXiv:1408.5110. doi:10.4007/annals.2016.183.3.3. MR 3488739.
26. Ford, Kevin; Green, Ben; Konyagin, Sergei; Maynard, James; Tao, Terence (2018). "Long gaps between primes". J. Amer. Math. Soc. 31 (1): 65–105. arXiv:1412.5029. doi:10.1090/jams/876. MR 3718451.
27. "Long gaps between primes / What's new".
28. Ford, Kevin; Maynard, James; Tao, Terence (2015-10-13). "Chains of large gaps between primes". arXiv:1511.04468 [math.NT].
29. Cramér, Harald (1936). "On the order of magnitude of the difference between consecutive prime numbers" (PDF). Acta Arithmetica. 2: 23–46. doi:10.4064/aa-2-1-23-46.
30. Sinha, Nilotpal Kanti (2010). "On a new property of primes that leads to a generalization of Cramer's conjecture". arXiv:1010.1399 [math.NT]..
31. Granville, Andrew (1995). "Harald Cramér and the distribution of prime numbers" (PDF). Scandinavian Actuarial Journal. 1: 12–28. CiteSeerX 10.1.1.129.6847. doi:10.1080/03461238.1995.10413946..
32. Granville, Andrew (1995). "Unexpected irregularities in the distribution of prime numbers" (PDF). Proceedings of the International Congress of Mathematicians. 1: 388–399. doi:10.1007/978-3-0348-9078-6_32. ISBN 978-3-0348-9897-3..
33. 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.
34. Guy (2004) §A8