# 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 1 between the only even prime number, 2, and the first odd prime, 3. All other prime gaps are even. There is only one pair of gaps between three consecutive odd natural numbers for which all are prime. These gaps are g2 and g3 between the primes 3, 5, and 7.

For any prime number P, we write P# for P primorial, that is, the product of all prime numbers up to and including P. If Q is the prime number following P, then the sequence

${\displaystyle P\#+2,P\#+3,\ldots ,P\#+(Q-1)}$

is a sequence of Q − 2 consecutive composite integers, so here there is a prime gap of at least length Q − 1. Therefore, there exist gaps between primes that are arbitrarily large, i.e., for any prime number P, there is an integer n with gnP. (This is seen by choosing n so that pn is the greatest prime number less than P# + 2.) Another way to see that arbitrarily large prime gaps must exist is the fact that the density of primes approaches zero, according to the prime number theorem. In fact, by this theorem, P# is very roughly a number the size of exp(P), and near exp(P) the average distance between consecutive primes is P.

In reality, prime gaps of P numbers can occur at numbers much smaller than P#. For instance, the smallest sequence of 71 consecutive composite numbers occurs between 31398 and 31468, whereas 71# has twenty-seven digits – its full decimal expansion being 557940830126698960967415390.

Although the average gap between primes increases as the natural logarithm of the integer, the ratio of the maximum prime gap to the integers involved also increases as larger and larger numbers and gaps are encountered.

In the opposite direction, the twin prime conjecture asserts that gn = 2 for infinitely many integers n.

## Numerical results

As of 2016 the largest known prime gap with identified probable prime gap ends has length 4680156, with 99750-digit probable primes found by Martin Raab. This gap has merit M=20.3767 The largest known prime gap with identified proven primes as gap ends has length 1113106, with 18662-digit primes found by P. Cami, M. Jansen and J. K. Andersen.[1][2]

We say that gn is a maximal gap, if gm < gn for all m < n. As of August 2016 the largest known maximal gap has length 1476, found by Tomás Oliveira e Silva. It is the 75th maximal gap, and it occurs after the prime 1425172824437699411.[3] Other record maximal gap terms can be found at .

Usually the ratio of gn / ln(pn) is called the merit of the gap gn . In 1931, E. Westzynthius proved that prime gaps grow more than logarithmically. That is,[4]

${\displaystyle \limsup _{n\to \infty }{\frac {g_{n}}{\log p_{n}}}=\infty .}$
Largest known merit values (As of June 2016)[5][6][7]
Merit gn digits pn Date Discoverer
36.590183 13692 163 1037600971*383#/210 - 8776 2016 Dana Jacobsen
35.424459 66520 816 1931*1933#/7230 - 30244 2012 Michiel Jansen
35.310308 1476 19 1425172824437699411 2009 Tomás Oliveira e Silva
34.975687 1442 18 804212830686677669 2005 Siegfried Herzog

As of June 2016, the largest known merit value, as discovered by D. Jacobsen, is 13692 / ln(1037600971*383#/210 - 8776) ≈ 36.590183 where 383# indicates the primorial of 383. The endpoints are 163-digit primes.

The Cramér–Shanks–Granville ratio is the ratio of gn / (ln(pn))^2.[5] The greatest known value of this ratio is 0.9206386 for the prime 1693182318746371. Other record terms can be found at .

The first 75 maximal gaps (n is not listed)
Number 1 to 25
# gn pn
1 1 2
2 2 3
3 4 7
4 6 23
5 8 89
6 14 113
7 18 523
8 20 887
9 22 1,129
10 34 1,327
11 36 9,551
12 44 15,683
13 52 19,609
14 72 31,397
15 86 155,921
16 96 360,653
17 112 370,261
18 114 492,113
19 118 1,349,533
20 132 1,357,201
21 148 2,010,733
22 154 4,652,353
23 180 17,051,707
24 210 20,831,323
25 220 47,326,693
Number 26 to 50
# gn pn
26 222 122,164,747
27 234 189,695,659
28 248 191,912,783
29 250 387,096,133
30 282 436,273,009
31 288 1,294,268,491
32 292 1,453,168,141
33 320 2,300,942,549
34 336 3,842,610,773
35 354 4,302,407,359
36 382 10,726,904,659
37 384 20,678,048,297
38 394 22,367,084,959
39 456 25,056,082,087
40 464 42,652,618,343
41 468 127,976,334,671
42 474 182,226,896,239
43 486 241,160,624,143
44 490 297,501,075,799
45 500 303,371,455,241
46 514 304,599,508,537
47 516 416,608,695,821
48 532 461,690,510,011
49 534 614,487,453,523
50 540 738,832,927,927
Number 51 to 75
# gn pn
51 582 1,346,294,310,749
52 588 1,408,695,493,609
53 602 1,968,188,556,461
54 652 2,614,941,710,599
55 674 7,177,162,611,713
56 716 13,829,048,559,701
57 766 19,581,334,192,423
58 778 42,842,283,925,351
59 804 90,874,329,411,493
60 806 171,231,342,420,521
61 906 218,209,405,436,543
62 916 1,189,459,969,825,483
63 924 1,686,994,940,955,803
64 1,132 1,693,182,318,746,371
65 1,184 43,841,547,845,541,059
66 1,198 55,350,776,431,903,243
67 1,220 80,873,624,627,234,849
68 1,224 203,986,478,517,455,989
69 1,248 218,034,721,194,214,273
70 1,272 305,405,826,521,087,869
71 1,328 352,521,223,451,364,323
72 1,356 401,429,925,999,153,707
73 1,370 418,032,645,936,712,127
74 1,442 804,212,830,686,677,669
75 1,476 1,425,172,824,437,699,411

## Further results

### Upper bounds

Bertrand's postulate proved 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 proved in 1896 says that the "average length" of the gap between a prime p and the next prime is ln(p). The actual length of the gap might be much more or less than this. However, from the prime number theorem one can also deduce an upper bound on the length of prime gaps: for every ε > 0, there is a number N such that gn < εpn for all n > N.

One can 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[8] 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,[9] and to θ = 3/4 + ε, for any ε > 0, by Chudakov.[10]

A major improvement is due to Ingham,[11] who showed that if

${\displaystyle \zeta (1/2+it)=O(t^{c})\,}$

for some positive constant c, where O refers to the big O notation, then

${\displaystyle \pi (x+x^{\theta })-\pi (x)\sim {\frac {x^{\theta }}{\log(x)}}}$

for any θ > (1 + 4c)/(2 + 4c). Here, as usual, ζ 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.[12] 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).[13]

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

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 it[15] 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.[16] A Polymath Project collaborative effort to optimize Zhang’s bound managed to lower the bound to 4680 on July 20, 2013.[17] 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 containing m prime numbers.[18] Using Maynard's ideas, the Polymath project improved the bound to 246;[17][19] assuming the Elliott–Halberstam conjecture and its generalized form, N has been reduced to 12 and 6, respectively.[17]

### Lower bounds

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 results by Erik 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γ.[20]

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

The result was further improved to

${\displaystyle g_{n}\gg {\frac {\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.[24]

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

## Conjectures about gaps between primes

Prime gap function

Even better results are possible under the Riemann hypothesis. Harald Cramér proved[26] 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.}$[27] It implies a strong form of Cramér's conjecture but is inconsistent with the heuristics of Granville and Pintz[28][29][30] 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, there is (under Oppermann's conjecture) an m>0 (probably m=30) for which every natural n>m satisfies ${\displaystyle g_{n}<{\sqrt {p_{n}}}.}$

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

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

## 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.[31] The function is neither multiplicative nor additive.

## References

1. ^ Andersen, Jens Kruse. "The Top-20 Prime Gaps". Retrieved 2014-06-13.
2. ^ A proven prime gap of 1113106
3. ^ Maximal Prime Gaps
4. ^ 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.
5. ^ a b NEW PRIME GAP OF MAXIMUM KNOWN MERIT
6. ^ Dynamic prime gap statistics
7. ^ TABLES OF PRIME GAPS
8. ^ Hoheisel, G. (1930). "Primzahlprobleme in der Analysis". Sitzunsberichte der Königlich Preussischen Akademie der Wissenschaften zu Berlin. 33: 3–11. JFM 56.0172.02.
9. ^ Heilbronn, H. A. (1933). "Über den Primzahlsatz von Herrn Hoheisel". Mathematische Zeitschrift. 36 (1): 394–423. doi:10.1007/BF01188631.
10. ^ Tchudakoff, N. G. (1936). "On the difference between two neighboring prime numbers". Math. Sb. 1: 799–814.
11. ^ Ingham, A. E. (1937). "On the difference between consecutive primes". Quarterly Journal of Mathematics. Oxford Series. 8 (1): 255–266. doi:10.1093/qmath/os-8.1.255.
12. ^ Cheng, Yuan-You Fu-Rui (2010). "Explicit estimate on primes between consecutive cubes". Rocky Mt. J. Math. 40: 117–153. doi:10.1216/rmj-2010-40-1-117. Zbl 1201.11111.
13. ^ Huxley, M. N. (1972). "On the Difference between Consecutive Primes". Inventiones Mathematicae. 15 (2): 164–170. doi:10.1007/BF01418933.
14. ^ 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.
15. ^ Goldston, D. A.; Pintz, J.; Yildirim, C. Y. (2007). "Primes in Tuples II". arXiv:0710.2728 [math.NT].
16. ^ Zhang, Yitang (2014). "Bounded gaps between primes". Annals of Mathematics. 179 (3): 1121–1174. doi:10.4007/annals.2014.179.3.7. MR 3171761.
17. ^ a b c "Bounded gaps between primes". Polymath. Retrieved 2013-07-21.
18. ^ Maynard, James (2015). "Small gaps between primes". Annals of Mathematics. 181 (1): 383–413. doi:10.4007/annals.2015.181.1.7. MR 3272929.
19. ^ 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.
20. ^ Pintz, J. (1997). "Very large gaps between consecutive primes". J. Number Theory. 63 (2): 286–301. doi:10.1006/jnth.1997.2081.
21. ^ Erdős, Some of my favourite unsolved problems
22. ^ 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.
23. ^ 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.
24. ^ Ford, Kevin; Green, Ben; Konyagin, Sergei; Maynard, James; Tao, Terence (2015). "Long gaps between primes". arXiv:1412.5029 [math.NT].
25. ^ Ford, Kevin; Maynard, James; Tao, Terence (2015-10-13). "Chains of large gaps between primes". arXiv:1511.04468 [math.NT].
26. ^ Cramér, Harald (1936). "On the order of magnitude of the difference between consecutive prime numbers" (PDF). Acta Arithmetica. 2: 23–46.
27. ^ Sinha, Nilotpal Kanti (2010). "On a new property of primes that leads to a generalization of Cramer's conjecture". arXiv:1010.1399 [math.NT]..
28. ^ Granville, A. (1995). "Harald Cramér and the distribution of prime numbers" (PDF). Scandinavian Actuarial Journal. 1: 12–28..
29. ^ Granville, Andrew (1995). "Unexpected irregularities in the distribution of prime numbers" (PDF). Proceedings of the International Congress of Mathematicians. 1: 388–399..
30. ^ Pintz, János (2007). "Cramér vs. Cramér: On Cramér's probabilistic model for primes". Funct. Approx. Comment. Math. 37 (2): 232–471.
31. ^ a b Guy (2004) §A8