Prime Gaps

DOWNLOAD Mathematica Notebook

A prime gap of length n is a run of n-1 consecutive composite numbers between two successive primes. 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 primes 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).

PrimeGaps

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

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

Wolf conjectures a slightly different form

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

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),
(4)

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.
(5)

It is known that there is a prime gap of length 803 following 90874329411493, and a prime gap of length 4247 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 probabilistic primes of 43429 digits each. In January-May 2004, Hans Rosenthal and Jens Kruse Andersen found a prime gap of length 2254930 between two probabilistic primes with 86853 digits each (Anderson 2004).

The merit of a prime gap compares the size of a gap to the local average gap, and is given by (p_(n+1)-p_n)/(lnp_n). In 1999, the number 1693182318746371 was found, with merit 32.2825. This remained the record merit until 804212830686677669 was found in 2005, with a gap of 1442 and a merit of 34.9757. Andersen maintains a list of the top 20 known merits. The prime gaps of increasing merit are 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 small n, omitting degenerate runs which are part of a run with greater n (OEIS A005250 and A002386).

np(n)np(n)
123544302407359
2338210726904659
4738420678048297
62339422367084959
88945625056082087
1411346442652618343
18523468127976334671
20887474182226896239
221129486241160624143
341327490297501075799
369551500303371455241
4415683514304599508537
5219609516416608695821
7231397532461690510011
86155921534614487453523
96360653540738832927927
1123702615821346294310749
1144921135881408695493609
11813495336021968188556461
13213572016522614941710599
14820107336747177162611713
154465235371613829048559701
1801705170776619581334192423
2102083132377842842283925351
2204732669380490874329411493
222122164747806171231342420521
234189695659906218209405436543
2481919127839161189459969825483
2503870961339241686994940955803
28243627300911321693182318746371
2881294268491118443841547845541059
2921453168141119855350776431903243
3202300942549122080873624627234849
3363842610773

Define

 Delta=lim inf_(n)(p_(n+1)-p_n)/(lnp_n)
(6)

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=lim inf_(n->infty)(d_n)/(lnp_n)
(7)
<=lim inf_(k->infty)(d_(n(k)))/(lnp_(n(k)))
(8)
=lim_(k->infty)2/(lnp_(n(k)))
(9)
=0.
(10)

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).

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.