Frequency of Occurrence of Prime Gaps

1.0 Content of this page

1.1 Introduction

The following equation was in principle first derived by Richard Brent in :
"The Distribution of Small Gaps Between Successive Primes",
Mathematics of Computation, volume 28, number 125, January 1974.

His work is based on the k-tuple conjecture by Hardy and Littlewood

We define : L(r,x) = number of conjectured occurrences of gaps of size 2 r between successive primes &le x.

The coefficients A(r,k) are defined in section (2.10) and their determination necessitates the calculations of the Hardy-Littlewood constants, section (2.8), and the integer valued function T(r,k), section (2.9). The integration of the natural logarithm to the power -(k+1) is addressed in section (2.12).

1.2 On the value for the lower integration limit

If one follows the ideas set forth by Hardy and Littlewood the lower integration limit would be a= 2. This value is fine for small values of the half-gap size but fails dramatically for higher values of r, i.e. L(80,100) = 1.738574e+18 and L(81,100) = -3.880588e+18. The underlying reason is that when 1/ln(x) is not small the influence of the large values of A(r,k) at higher values of k become dominant. This phenomena is investigated in detail which leads to the suggestion of setting the lower integration limit equal to the prime gap size 2*r itself and defining L(r,x) = 0 for x ≤ 2*r. This is applied to all the following investigations. Note that this change in the value of the lower integration limit is equivalent to adding a constant value to the distribution integral and does in no way effect the trends exhibited by the distribution integral.

1.3 Champions of prime gaps

In Figure 1 below we show the three most dominant prime gaps as function of x ( up to x=10100 ) with Table 3 giving the precise values of the cross-over points. In generating these data all gap sizes less/equal to 170 have been incorporated. The gap count ( vertical axis ) at each value of x is normalized by L(1,x) = conjectured gap count for gap size 2.

Figure 1 : The three most dominant prime gaps
Table 1 : Cross-over between gap counts
g1 g2 Cross-over at x=Gap Count
268.2581888285e+002 41
2121.3632877013e+006 10703
2103.4910495617e+008 1,335,992
6301.7427435732e+035 69,741,767,360,943,899,452,043,123,936,486
6601.2366228237e+079 9.836684135768302589239070756294895629490e+074
6421.0582079761e+083 7.639346167266082889688692174112777343850e+078
6841.2946471321e+180 1.986874879089725e+175
6661.6794746227e+237 1.485932681131118e+232
678   5.8779855093e+343 2.476753293373477e+338
302106.4286910626e+425 2.300978450662639e+420
10123.4792747497e+004 386
10184.9717510565e+009 15,130,504
18306.8491969004e+019 67,744,622,610,468,793
12301.4100294833e+027 867,485,509,647,024,041,245,230
12421.5461226469e+070 1.509080763452346916841999784189568721423e+066
42602.0297974121e+072 1.878995908475533708182917485403725486180e+068

Table 2, 3, and 4 present the data in numerical form.

Table 2 : Most common gaps
x ≤ 8.2581888285e+02 2
8.2581888285e+02 < x ≤ 1.7427435732e+35 6
1.7427435732e+35 < x ≤ ??? 30
Table 3 : 2nd most common gaps
x ≤ 8.2581888285e+02 6
8.2581888285e+02 < x ≤ 1.3632877013e+062
1.3632877013e+06 < x ≤ 1.4100294833e+2712
1.4100294833e+27 < x ≤ 1.7427435732e+3530
1.7427435732e+35 < x ≤ 1.2366228237e+796
1.2366228237e+79 < x ≤ ????? 60
Table 4 : 3rd most common gaps
x ≤ 3.4792747497e+0410
3.4792747497e+04 < x ≤ 1.3632877013e+0612
1.3632877013e+06 < x ≤ 3.4910495617e+082
3.4910495617e+08 < x ≤ 4.9717510565e+0910
4.9717510565e+09 < x ≤ 6.8491969004e+1918
6.8491969004e+19 < x ≤ 1.4100294833e+2730
1.4100294833e+27 < x ≤ 1.5461226469e+7012
1.5461226469e+70 < x ≤ 2.0297974121e+7242
2.0297974121e+72 < x ≤ 1.2366228237e+7960
1.2366228237e+79 < x ≤ 1.0582079761e+83 6
1.0582079761e+83 < x ≤ ???42

1.4Gap size 210 as champion

This gap size ( r=105=3*5*7 ) will ultimately occur more frequently than the gap size of 30 ( r=15=3*5 ) because A(105,1)=4.2250.... while A(15,1)= 3.5208... In their article "Jumping Champions, by Andrew Odlyzko,Michael Rubenstein, and Marek Wolf, Experimental Mathematics 8:2, pp 107, 1999" the authors estimate that this will occur around x=10425. They arrive at this value by using the Hardy-Littlewood conjecture with Brent's addition and derive at an approximation for the value of the coefficients A(r,k) :

A(r,k+1) = A(r,k) (2 r) / k ;

The table below, depicting the known values of A(105,k), shows that this approximation becomes poor as the value of k increases even to moderate values giving room to the possibility to improve the accuracy of their predictions. The shown non-zero values for A(105,k) were obtained with an older program.

A newer, significantly faster version is presently being used on computers at the Research Computing and Cyberinfrastructure unit of the Penn State University. This newer program will not provide the missing A(105,k) values one at a time . Hence the data below will not be appended until the last day of those calculations which was accomplished on Sept. 9, 2011. ( I just haven't gotten around to upgrade this very webpage).

In the mean time, we provide an estimate for the conjectured cross-over point using A(105,k)=0   for k=15 ... 31 and the known values otherwise. We obtain :

x=6.4286910626e+425 with L(15,x)=L(105,x)= 2.300978e+420

as the conjectured location of the cross-over point between half-gap sizes 15 and 105.

105 10.42250356214199652731379975040931569819687895058223e1
105 20.85527141397870327432752225658744233041868536636982e3
105 30.83679268833333575848239200115324655776773425730927e5
105 40.52713932786775926477065630548848125861397712854402e7
105 50.24031109723025721022828295056107545855163721112336e9
105 60.84482197025174599431640048491871145623171319770618e10
105 70.23832996966571917474121707433677545652057844026111e12
105 80.5543373473869664854698948292944986962848931965362e13
105 90.10839395312848959796428394410051599250560223440454e152.946

It stands to reason that values of A(105,k) for even moderate values of k might have negligible influence on these results. This is supported by the observation that the inclusion of approximate values for the missing A(105,k) (instead of 0) produces no changes to the value of the characteristics of the cross-over point to all shown digits. Approximate values for the "missing" A(105,k) were obtained by using a cubic parabola whose value match the logarithms of the known A(105,k) for k=13,14,33, and 34. This curve fit is shown in the figure below.

Based on that, the shown value for the location of the cross-over point will not be improved upon through the inclusion of the as of yet unkown A(105,k).

1.5 Two global checks on conjectured prime gap distribution

Check 1 :

We expect S1 to be equal to x at lower values of x but below at higher values because only prime gaps up to 2*rMax=200 are included. Quantity E1 in the table below is the relative error :

E1 = ( S1 - x ) / x

Check 2 :

We expect CPC(x) = conjectured prime count to be a good representation of the actual prime count pi(x), again with the caveat that we included only gaps of size ≤ 200 in our summation and therefore expect that CPC(x) lags increasingly behind pi(x). Quantity E2 in the table below is the relative error :

E2 = ( CPC(x) - &pi(x) ) / &pi(x);

xS1(x)E1(x)CPC(x) π(x)E2(x)
1.000000e+03 1.007824e+03 +7.824e-03 180.1 168+7.209e-02
1.000000e+04 1.000782e+04 +7.824e-04 1248.6 1229+1.598e-02
1.000000e+05 1.000078e+05 +7.824e-05 9632.3 9592+4.202e-03
1.000000e+06 1.000008e+06 +7.815e-06 78630.1 78498+1.682e-03
1.000000e+07 1.000000e+07 +2.191e-07 664920.9 664579+5.144e-04
1.000000e+08 9.999916e+07 -8.418e-06 5762207.9 5761455+1.307e-04
1.000000e+09 9.999427e+08 -5.729e-05 50848973.2 50847534+2.830e-05
1.000000e+10 9.997639e+09 -2.361e-04 455044844.2 455052511-1.685e-05
1.000000e+11 9.992976e+10 -7.024e-04 4117749164.5 4118054813-7.422e-05
1.000000e+12 9.983331e+11 -1.667e-03 37600499324.6 37607912018-1.971e-04
1.000000e+13 9.966419e+12 -3.358e-03 345917063773.2 346065536839-4.290e-04
1.000000e+14 9.940132e+13 -5.987e-03 3202319815222.6 3204941750802-8.181e-04
1.000000e+15 9.902804e+14 -9.720e-03 29802423350712.7 29844570422669-1.412e-03
1.000000e+16 9.853335e+15 -1.467e-02 278608630196206.0 279238341033925-2.255e-03
1.000000e+17 9.791212e+16 -2.088e-02 2614680420169527.1 2623557157654233-3.383e-03
1.000000e+18 9.716443e+17 -2.836e-02 24620566699367522.9 24739954287740860-4.826e-03
1.000000e+19 9.629466e+18 -3.705e-02 232512563636037553.3 234057667276344607-6.601e-03
1.000000e+20 9.531039e+19 -4.690e-02 2201450216061675789.8 2220819602560918840-8.722e-03
1.000000e+21 9.422140e+20 -5.779e-02 20890846484455690668.321127269486018731928-1.119e-02
1.000000e+22 9.303881e+21 -6.961e-02 198645803294329157125.0201467286689315906290-1.400e-02
1.000000e+23 9.177432e+22 -8.226e-02 1892288791207365028076.91925320391606803968923-1.716e-02
1.000000e+23 8.655046e+22 -1.345e-01 1863996849660944330905.71925320391606803968923-3.185e-02
At the bottom of the above table we have two entries at x=1.0e+23. The last was from an earlier table and included only gaps of size 170 and less. The reduction in error due to the inclusion of the contributions of larger gap size is quite remarkable.

1.6 Comparing conjectured with actual prime gap distribution

Counts of the actual distribution of prime gaps were conducted up until 2004 by myself covering the range from 2 to 2*1016 and since then in collaboration with Oliveira e Silva as part of the ongoing Goldbach conjecture verification project which sofar ( July 2011) has yielded the counts of all prime gaps up to 2.2*1018.

Comparison of actual and conjectured counts of prime gaps

Richard P. Brent , "Irregularities in the Distribution of Primes and Twin Primes", Mathematics of Computations,Vol 29, No. 129 (Jan 1975) suggested that the difference between the actual count of primes and the ones predicted by the logarithmic integral or Riemann's hypothesis is usually of order x1/2/ln(x) and that this result can be extended to the count of twin primes as well. In the graphs and tables linked to below we show that this can be, at least in first approximation, extended to even higher prime gaps.

The graphs and tables linked to below provide the actual and the conjectured gap counts plus their differences and normalized differences on a fairly coarse grid ( some 1100 points per graph ). This leaves open the possibility that in between some of the shown data points differences between actual and conjectured gap counts are larger than those shown and that sign change ( +/- ) of the difference occur more frequently as well.

2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
62 64 66 68 70 72 74 76 78 80 82 84 86 88 90
92 94 96 98 100 102 104 106 108 110 112 114 116 118 120
122 124 126 128 130 132 134 136 138 140 142 144 146 148 150
152 154 156 158 160 162 164 166 168 170 172 174 176 178 180
182 184 186 188 190 192 194 196 198 200

1.7 First Occurrences of Prime Gaps

First Occurrences of Prime Gaps

1.8 Programs and Flow of Data (More for myself)

Zig Herzog;
Last revised: 07/07/11