TOPICS
Search

Prime Gaps


A prime gap of length n is a run of n-1 consecutive composite numbers between two successive primes, where n is a positive integer. Therefore, the difference between two successive primes p_k and p_(k+1) bounding a prime gap of length n is p_(k+1)-p_k=n, where p_k is the kth prime number. Since the prime difference function

 d_k=p_(k+1)-p_k
(1)

is always even (except for p_1=2), all prime gaps >1 are also even. The notation p(n) is commonly used to denote the smallest prime p_k corresponding to the start of a prime gap of length n, i.e., such that p(n)=p_k is prime, p(n)+1, p(n)+2, ..., p(n)+n-1 are all composite, and p_(k+1)=p(n)+n is prime (with the additional constraint that no smaller number satisfying these properties exists).

The maximal prime gap G(N) is the length of the largest prime gap that begins with a prime p_k less than some maximum value N. For n=1, 2, ..., G(10^n) is given by 4, 8, 20, 36, 72, 114, 154, 220, 282, 354, 464, 540, 674, 804, 906, 1132, ... (OEIS A053303).

Arbitrarily large prime gaps exist. For example, for any n>1, the numbers n!+2, n!+3, ..., n!+n are all composite (Havil 2003, p. 170). However, no general method more sophisticated than an exhaustive search is known for the determination of first occurrences and maximal prime gaps (Nicely 1999).

Writing ln_k for the k-fold nested logarithm, Ford et al. (2018) proved the asymptotic lower bound

 G(T)>>(lnTln_2Tln_4T)/(ln_3T).
(2)

GPT 5.6 Sol (2026) claimed the stronger bound

 G(T)>>(lnTln_2T)/(ln_4T),
(3)

an improvement by a factor of ln_3T/(ln_4T)^2. The paper identifies GPT 5.6 Sol as its author. Alexeev (2026) formalized the two main statements unconditionally in Lean. After discussions with Terry Tao and James Maynard, Green (2026) reported that he was "more or less convinced" that the result was correct. The manuscript has not been refereed, and the correspondence between the manuscript and formalization has not received independent review (VibeMathed 2026).

PrimeGaps

Cramér (1937) and Shanks (1964) conjectured that

 p(n)∼exp(sqrt(n)).
(4)

Wolf conjectures a slightly different form

 p(n)∼sqrt(n)exp(sqrt(n)),
(5)

which agrees better with numerical evidence.

Wolf conjectures that the maximal gap G(n) between two consecutive primes less than n appears approximately at

 G(n)∼n/(pi(n))[2lnpi(n)-lnn+ln(2C_2)]=g(n),
(6)

where pi(n) is the prime counting function and C_2 is the twin primes constant. Setting pi(n)∼n/lnn reduces to Cramer's conjecture for large n,

 G(n)∼(lnn)^2.
(7)

It is known that there is a prime gap of length 804 following 90874329411493, and a prime gap of length 4248 following 10^(314)-1929 (Baugh and O'Hara 1992). H. Dubner (2001) discovered a prime gap of length 119738 between two 3396-digit probable primes. On Jan. 15, 2004, J. K. Andersen and H. Rosenthal found a prime gap of length 1001548 between two probable primes of 43429 digits each. In January-May 2004, Hans Rosenthal and Jens Kruse Andersen found a prime gap of length 2254930 between two probable primes with 86853 digits each (Andersen 2004).

The average prime gap through p_n is (p_n-2)/(n-1) for n>=2 and is asymptotic to lnp_n by the prime number theorem. This average grows without bound even though bounded gaps occur infinitely often. The merit of an individual prime gap compares it to this local average scale, and is given by (p_(n+1)-p_n)/(lnp_n). As of Oct. 2026, the largest known merit for a gap between proven primes is 42.5192, attained by a gap of length 59724 following a 611-digit prime number and discovered by M. Vojvoda (Prime Gap List Project 2026, Vojvoda 2026). A larger merit of 42.5402 is listed for a gap of length 14282 between 146-digit probable primes discovered by S. Troisi (Prime Gap List Project 2026). The primes preceding gaps of increasing record merit begin 2, 3, 7, 113, 1129, 1327, 19609, ... (OEIS A111870).

Young and Potler (1989) determined the first occurrences of prime gaps up to 72635119999997, with all first occurrences found between 1 and 673. Nicely (1999) has extended the list of maximal prime gaps. The following table gives the values of p(n) for record gaps, namely gaps longer than every preceding prime gap (OEIS A005250 and A002386). As of Oct. 16, 2026, the confirmed records extend through a gap of length 1854 following 101412319996363309069 (Andersen and Luhn 2026). First occurrences of lengths that do not set a record, such as the gap of length 10 following 139, are omitted.

np(n)np(n)
12490297501075799
23500303371455241
47514304599508537
623516416608695821
889532461690510011
14113534614487453523
18523540738832927927
208875821346294310749
2211295881408695493609
3413276021968188556461
3695516522614941710599
44156836747177162611713
521960971613829048559701
723139776619581334192423
8615592177842842283925351
9636065380490874329411493
112370261806171231342420521
114492113906218209405436543
11813495339161189459969825483
13213572019241686994940955803
148201073311321693182318746371
1544652353118443841547845541059
18017051707119855350776431903243
21020831323122080873624627234849
220473266931224203986478517455989
2221221647471248218034721194214273
2341896956591272305405826521087869
2481919127831328352521223451364323
2503870961331356401429925999153707
2824362730091370418032645936712127
28812942684911442804212830686677669
292145316814114761425172824437699411
320230094254914885733241593241196731
336384261077315106787988999657777797
3544302407359152615570628755536096243
38210726904659153017678654157568189057
38420678048297155018361375334787046697
39422367084959155218470057946260698231
45625056082087157218571673432051830099
46442652618343167620733746510561442863
468127976334671172468068810283234182907
4741822268962391854101412319996363309069
486241160624143

Define

 Delta=liminf_(n)(p_(n+1)-p_n)/(lnp_n)
(8)

as the infimum limit of the ratio of the nth prime difference to the natural logarithm of the nth prime number. If there are an infinite number of twin primes, then Delta=0. This follows since it must then be true that d_n=2 infinitely often, say at n=n(k) for k=1, 2, ..., so a necessary condition for the twin prime conjecture to hold is that

Delta=liminf_(n->infty)(d_n)/(lnp_n)
(9)
<=liminf_(k->infty)(d_(n(k)))/(lnp_(n(k)))
(10)
=lim_(k->infty)2/(lnp_(n(k)))
(11)
=0.
(12)

However, this condition is not sufficient, since the same proof works if 2 is replaced by any constant.

Hardy and Littlewood showed in 1926 that, subject to the truth of the generalized Riemann hypothesis, Delta<=2/3. This was subsequently improved by Rankin (again assuming the generalized Riemann hypothesis) to Delta<=3/5. In 1940, Erdős used sieve theory to show for the first time with no assumptions that Delta<1. This was subsequently improved to 15/16 (Ricci), (2+sqrt(3))/8=0.46650... (Bombieri and Davenport 1966), and (2sqrt(2)-1)/4=0.45706... (Pil'Tai 1972), as quoted in Le Lionnais (1983, p. 26). Huxley (1973, 1977) obtained 1/4+pi/16=0.44634..., which was improved by Maier in 1986 to Delta<=0.2486, which was the best result known until 2003 (American Institute of Mathematics).

At a March 2003 meeting on elementary and analytic number theory in Oberwolfach, Germany, Goldston and Yildirim presented an attempted proof that Delta=0. While the original proof turned out to be flawed (Mackenzie 2003ab), the result has now been established by a new proof (American Institute of Mathematics 2005, Cipra 2005, Devlin 2005, Goldston et al. 2005ab).

Zhang (2014) subsequently proved the much stronger unnormalized result that the infimum limit H_1=liminf_(n->infty)(p_(n+1)-p_n) is finite, initially obtaining H_1<7×10^7. Work of Maynard (2015) and the Polymath8 project then reduced the unconditional bound to H_1<=246 (Polymath 2014). Thus infinitely many pairs of consecutive primes differ by at most 246. This result on bounded gaps between primes does not prove that a gap of exactly 2 occurs infinitely often, so it does not prove the twin prime conjecture.

Assuming the Elliott-Halberstam conjecture gives the conditional bound H_1<=12 (Maynard 2015). It also gives H_2<=270 (Polymath 2014), improving Maynard's earlier bound H_2<=600. The stronger generalized conjecture gives H_1<=6 and H_2<=252 (Polymath 2014). Neither conditional result proves that H_1=2.

OpenAI (2026a) reported the stronger maximal-gap lower bound

 G(T)>>(lnT(ln_2T)^2ln_4T)/((ln_3T)^2),
(13)

where ln_j again denotes the j-fold nested natural logarithm. GPT-6 Astra discovered the proof. VibeMathed's September verification replayed the Lean proof and checked its axioms, but independent mathematical review of the new argument had not been reported as of Sep. 7, 2026.

Mossinghoff and Trudgian (2026) call a consecutive-prime gap (p_n,p_(n+1)) frangible when every integer strictly between its endpoints has a least prime factor strictly less than the gap p_(n+1)-p_n. This is the property in Erdős problem 682. Assuming the Dickson-Hardy-Littlewood prime-tuples conjecture, the number F(X) of such gaps with left endpoint X<p_n<2X satisfies

 F(X)∼(cX)/((lnX)^2),
(14)

where 2.7416<c<2.7984. The constant bounds are rigorous, while the counting asymptotic is conditional (Mossinghoff and Trudgian 2026).


See also

Average Prime Gap, Bounded Gaps Between Primes, Cramér-Granville Conjecture, Elliott-Halberstam Conjecture, Jumping Champion, Nearest Prime, Prime Constellation, Prime Difference Function, Prime Distance, Shanks' Conjecture, Twin Composites, Twin Prime Conjecture, Twin Primes

Explore with Wolfram|Alpha

References

Alexeev, B. "Erdos4Tilted.lean." 27 Aug 2026. https://github.com/plby/lean-proofs/blob/main/src/latest/ErdosProblems/Erdos4Tilted.lean.American Institute of Mathematics. "Breakthrough in Prime Number Theory." May 24, 2005. https://aimath.org/.American Institute of Mathematics. "Small Gaps between Consecutive Primes: Recent Work of D. Goldston and C. Yildirim." https://web.archive.org/web/20030402135321/http://aimath.org:80/goldston_tech/.Andersen, J. K. "A Prime Gap of 1001548." Jan. 15, 2004. https://listserv.nodak.edu/cgi-bin/wa.exe?A2=ind0401&L=nmbrthry&F=&S=&P=397.Andersen, J. K. "A Prime Gap of 2254930." June 2, 2004. https://listserv.nodak.edu/cgi-bin/wa.exe?A2=ind0406&L=nmbrthry&P=601.Andersen, J. K. "First Known Prime Megagap." https://web.archive.org/web/20120316200641/http://hjem.get2net.dk/jka/math/primegaps/megagap.htm.Andersen, J. K. "Largest Known Prime Gap." https://web.archive.org/web/20110130014046/http://hjem.get2net.dk:80/jka/math/primegaps/megagap2.htm.Andersen, J. K. "Top-20 Prime Gaps." https://web.archive.org/web/20120530023930/http://hjem.get2net.dk:80/jka/math/primegaps/gaps20.htm.Andersen, J. K. and Luhn, N. "Record Prime Gaps." Oct. 12, 2026. https://www.pzktupel.de/RecordGaps/Risinggap.php.Baugh, D. and O'Hara, F. "Large Prime Gaps." J. Recr. Math. 24, 186-187, 1992.Berndt, B. C. Ramanujan's Notebooks, Part IV. New York: Springer-Verlag, pp. 133-134, 1994.Bombieri, E. and Davenport, H. "Small Differences between Prime Numbers." Proc. Roy. Soc. A 293, 1-18, 1966.Brent, R. P. "The First Occurrence of Large Gaps between Successive Primes." Math. Comput. 27, 959-963, 1973.Brent, R. P. "The Distribution of Small Gaps between Successive Primes." Math. Comput. 28, 315-324, 1974.Brent, R. P. "The First Occurrence of Certain Large Prime Gaps." Math. Comput. 35, 1435-1436, 1980.Caldwell, C. "The Gaps between Primes." https://t5k.org/notes/gaps.html.Cipra, B. "Proof Promises Progress in Prime Progressions." Science 304, 1095, 2004.Cipra, B. "Third Time Proves Charm for Prime-Gap Theorem." Science 308, 1238, 2005.Cramér, H. "On the Order of Magnitude of the Difference between Consecutive Prime Numbers." Acta Arith. 2, 23-46, 1937.Cutter, P. A. "Finding Prime Pairs with Particular Gaps." Math. Comput. 70, 1737-1744, 2001.Devlin, K. "Major Advance on the Twin Primes Conjecture." May 24, 2005. https://web.archive.org/web/20211107035519/https://www.maa.org/news/052505twinprimes.html.Dubner, H. "New Large Prime Gap Record." Dec. 13, 2001. https://listserv.nodak.edu/cgi-bin/wa.exe?A2=ind0112&L=nmbrthry&P=1093.Ford, K.; Green, B.; Konyagin, S.; Maynard, J.; and Tao, T. "Long Gaps between Primes." J. Amer. Math. Soc. 31, 65-105, 2018. https://doi.org/10.1090/jams/876.Fouvry, É. "Autour du théorème de Bombieri-Vinogradov." Acta. Math. 152, 219-244, 1984.Fouvry, É. and Grupp, F. "On the Switching Principle in Sieve Theory." J. reine angew. Math. 370, 101-126, 1986.Fouvry, É. and Iwaniec, H. "Primes in Arithmetic Progression." Acta Arith. 42, 197-218, 1983.Gafni, A. and Tao, T. "Rough Numbers between Consecutive Primes." 8 Aug 2025. https://arxiv.org/abs/2508.06463.Goldston, D. A.; Graham, S. W.; Pintz, J.; and Yildirim, C. Y. "Small Gaps between Primes or Almost Primes." Jun. 3, 2005a. https://arxiv.org/abs/math/0506067.Goldston, D. A.; Motohashi, Y.; Pintz, J.; and Yildirim, C. Y. "Small Gaps between Primes Exist." May 14, 2005b. https://arxiv.org/abs/math/0505300.GPT 5.6 Sol. "A Tilted Residue-Class Construction for Long Prime-Free Intervals." Aug. 25, 2026. https://github.com/DottedCalculator/ai-math/blob/main/Erdos_4_GPT_5.6_Sol.pdf.Green, B. Comment on "A Tilted Residue-Class Construction for Long Prime-Free Intervals." Erdős Problems, 27 Aug 2026. https://www.erdosproblems.com/forum/thread/proof-claim:a86e01428bc943c4a8fca864cfb22bfe#post-8615.Guy, R. K. "Gaps between Primes. Twin Primes" and "Increasing and Decreasing Gaps." §A8 and A11 in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, pp. 19-23 and 26-27, 1994.Havil, J. Gamma: Exploring Euler's Constant. Princeton, NJ: Princeton University Press, 2003.Huxley, M. N. "Small Differences between Consecutive Primes." Mathematica 20, 229-232, 1973.Huxley, M. N. "Small Differences between Consecutive Primes. II." Mathematica 24, 142-152, 1977.Lander, L. J. and Parkin, T. R. "On First Appearance of Prime Differences." Math. Comput. 21, 483-488, 1967.Le Lionnais, F. Les nombres remarquables. Paris, France: Hermann, 1983.Mackenzie, D. "Prime Proof Helps Mathematicians Mind the Gaps." Science 300, 32, 2003a.Mackenzie, D. "Prime-Number Proof's Leap Falls Short." Science 300, 1066, 2003b.Maynard, J. "Small Gaps between Primes." Ann. Math. 181, 383-413, 2015. https://doi.org/10.4007/annals.2015.181.1.7.Montgomery, H. "Small Gaps Between Primes." Mar. 13, 2003. https://listserv.nodak.edu/cgi-bin/wa.exe?A2=ind0303&L=nmbrthry&P=1323.Mossinghoff, M. J. and Trudgian, T. S. "Frangible Prime Gaps." 25 Oct 2026. https://arxiv.org/abs/2610.34525.Nicely, T. R. "New Maximal Prime Gaps and First Occurrences." Math. Comput. 68, 1311-1315, 1999. https://doi.org/10.1090/S0025-5718-99-01065-0.Nicely, T. R. "First Occurrence Prime Gaps." https://oeis.org/A000101/a000101.pdf.Update a linkNicely, T. R. and Nyman, B. "First Occurrence of a Prime Gap of 1000 or Greater." https://faculty.lynchburg.edu/~nicely/gaps/gaps2.htmlNumberphile. "Large Gaps Between Primes." Jul. 19, 2017. https://www.youtube.com/watch?v=BH1GMGDYndo.Nyman, B. and Nicely, T. R. "New Prime Gaps Between 10^(15) and 5×10^(16)." J. Int. Seq. 6, 1-6, 2003.OpenAI. "Improved Long Gaps Between Primes." 2026a. https://github.com/openai/LongGapsBetweenPrimes.Polymath, D. H. J. "Variants of the Selberg Sieve, and Bounded Intervals Containing Many Primes." Res. Math. Sci. 1, Article 12, 2014. https://doi.org/10.1186/s40687-014-0012-7.Prime Gap List Project. "Top 20 Overall Merits." Accessed Oct. 5, 2026. https://primegap-list-project.github.io/lists/top20-overall-merits/.Rivera, C. "Problems & Puzzles: Puzzle 011-Distinct, Increasing & Decreasing Gaps." https://www.primepuzzles.net/puzzles/puzz_011.htm.Shanks, D. "On Maximal Gaps between Successive Primes." Math. Comput. 18, 646-651, 1964.Sloane, N. J. A. Sequences A002386/M0858, A005250, A008950, A008995, A008996, A030296, A053303, and A111870 in "The On-Line Encyclopedia of Integer Sequences."Soundararajan, K. "Small Gaps between Prime Numbers: The Work of Goldston-Pintz-Yildirim." Bull. Amer. Math. Soc. 44, 1-18, 2007.Veritasium. "We're 99.9% Sure This Pattern Is True, but No One Can Prove It." Jun. 14, 2026. https://www.youtube.com/watch?v=8HBDE-msUjw.Vojvoda, M. "BEACON: A GPU Search for Large Prime Gaps in Primorial Windows, with a New Record Merit." Sept. 25, 2026. https://doi.org/10.5281/zenodo.22963326.Wolf, M. "First Occurrence of a Given Gap between Consecutive Primes." https://mwolf.pracownicy.uksw.edu.pl/firstocc.pdf.Wolf, M. "Some Conjectures on the Gaps between Consecutive Primes." https://mwolf.pracownicy.uksw.edu.pl/conjectures.pdf.Young, J. and Potler, A. "First Occurrence Prime Gaps." Math. Comput. 52, 221-224, 1989.Zhang, Y. "Bounded Gaps between Primes." Ann. Math. 179, 1121-1174, 2014. https://doi.org/10.4007/annals.2014.179.3.7.

Referenced on Wolfram|Alpha

Prime Gaps

Cite this as:

Weisstein, Eric W. "Prime Gaps." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PrimeGaps.html

Subject classifications