Talk:Prime gap

June 24th, 2006: Under 'Further results' it states: "To verify this, as of 2006 still unresolved, problem a stronger result such as Cramér's conjecture would be needed." Shouldn't this be rewritten? I think there's an error in the buildup of the sentence.

Prime gaps that are they prime numbers themselves
Is there any prime kind described as such? Or such description would be impossible? What would be a required alteration (dvision by, subtraction of, subtraction of and division by, reduction to 2nd, 3rd, n root, etc.) to get a prime from any known prime gap chosen?


 * Well, 2 is the only even prime, so all prime gaps are even, and therefore they can only be prime themselves in the case that the gap is 2. However, if you divide the gaps by 2 some of them will be prime. 84.70.102.3 01:56, 17 February 2007 (UTC)

Table of maximal gaps
The table with heading "Length range" has been inserted and removed several times. It originates from (the full table is in the source). It was properly explained there but somebody redirected Prime desert to this article and copied the table without explanation. It's actually a table of maximal gaps (defined in this article), but the table doesn't say so, and it ends a gap at the composites (with odd length) instead of the primes (with even length). I find the table in its current form inappropriate for Prime gap, but a properly defined table of maximal gaps (listing primes and even lengths) would be fine by me. My own site has such a table at. It's also at the Prime Pages (uses odd gap lengths). Should this article have a table of maximal gaps? If so, should it list all 72 known gaps or only some of them? PrimeHunter 01:27, 21 October 2006 (UTC)

Today I added a table of the 72 known maximal gaps with 3 per line to reduce the table length. It lists gn and pn, but not pn+1 (which is pn+gn) or n (which is not listed by any reference). PrimeHunter 02:58, 6 November 2006 (UTC)

The current table (2017 Dec. 29) only has the first 75. 76 and 77 are listed before the table but should be added to the table itself. As the table has two slightly different columns of equal length, the additions would make the columns unequal. I only have a limited time at the library internet, so I will leave the table change to someone else. agb — Preceding unsigned comment added by 173.233.167.63 (talk) 20:34, 29 December 2017 (UTC)

How composite are the numbers in the prime gap?
I suppose it is a matter of speculation, but is the number that immediately follows the prime the most composite number in the prime gap? Has anyone tried to assign weights to the numbers in the prime gap? For instance, weights could correspond directly to the number of factors found per number in the gap. If this has already been done, and I believe it is reasonable to say it has, is the most richly composite number there, immediately next to the first or last prime there?

The main article would be improved if someone posted a chart reflecting the distribution of abundant numbers located between the two primes that frame the gap. I have a gut feeling that the number immediately after the prime is an "abundant number" but of course that's really not good enough to go by when looking for primes. Dexter Nextnumber (talk) 22:02, 27 December 2009 (UTC)


 * Regarding terminology, the Big Omega function is the number of prime factors, and a number with k prime factors is called a k-almost prime. I haven't heard of anybody studying how these vary inside prime gaps, and it doesn't sound particular interesting to me. A lot has been published about prime gaps and we shouldn't add our own tables and observations about things nobody has studied. Wikipedia articles are not for original research but for presenting what others have already said. I see no reason to expect that the largest number of prime factors should often be next to the primes for large prime gaps. 64 = 26 is in the middle of the prime gap between 61 and 67. And there are probably infinitely many cases of consecutive odd primes (p, q) such that (p+1)/2 and (q-1)/2 are both prime. The first cases (starting with two where it's the same prime) are: (3,5), (5,7), (2017,2027), (2557,2579), (4273,4283), (9973,10007), (15277,15287), (18097,18119), (20533,20543), (20641,20663), (28297,28307), (29101,29123), (29473,29483), (29641,29663), (30781,30803), (31573,31583), (32173,32183), (33757,33767), (36457,36467), (36877,36887), (43597,43607), (59053,59063), (60637,60647), (65677,65687), (67537,67547), (69877,69899), (78877,78887), (81517,81527), (81637,81647), (82153,82163), (83233,83243), (87433,87443), (89293,89303), (97177,97187), (98953,98963). Table of prime factors and Table of divisors show factorizations and divisor statistics up to 1000. There is no need to duplicate that information in the prime gap article. PrimeHunter (talk) 02:00, 28 December 2009 (UTC)

Firoozbakht’s conjecture
Should there be a section on how big is the prime gap is in respect to Firoozbakht’s conjecture?

John W. Nicholson (talk) 20:49, 6 September 2012 (UTC)


 * Probably not. It's not a well-known conjecture, and it's almost surely false. CRGreathouse (t | c) 03:41, 9 September 2012 (UTC)


 * "it's almost surely false."? Why are you saying that? What weighs against it? John W. Nicholson (talk) 21:17, 9 September 2012 (UTC)
 * For one thing, it contradicts the Cramér–Granville conjecture. There is some relevant discussion on Mathoverflow.—Emil J. 15:08, 10 September 2012 (UTC)


 * While I agree that Firoozbakht’s conjecture contradicts the Cramér–Granville conjecture, I do not see how this adds any weight on the issue both are conjectures. Something else would be needed to direct me to say that adds to or takes from it. It seems to me that a statement is like 'there is a constant a such that p_(n+1)-p_n = (log(p_n) - log(a))^2 is true' can be agreed upon, but the value of a has not. But, notice what this does for a as p_n increases. Which way is better? And, why better? — Preceding unsigned comment added by Reddwarf2956 (talk • contribs) 20:25, 11 September 2012 (UTC)


 * I think your formula is not what you intended to type, so I won't comment on that. But I think that very few people believe that $$p_{n+1}-p_n<\log^2p_n$$ for all n (the naive version of the Cramér conjecture), and consequently few believe Firoozbakht’s conjecture. I don't even know that Farideh believes it anymore... maybe I'll Facebook her and see what she thinks.
 * CRGreathouse (t | c) 03:33, 14 September 2012 (UTC)

Awkward statement
"Note however that not even the Lindelöf hypothesis, which assumes that we can take c to be any positive number, implies that there is a prime number between n2 and (n + 1)2, if n is sufficiently large (see Legendre's conjecture)."

This an awkward statement to the point that I do not get it. Can someone please rewrite it? John W. Nicholson (talk) 18:37, 12 April 2014 (UTC)

I am guessing this means

The Lindelöf hypothesis, which assumes that we can take c to be any positive number, does not imply Legendre's conjecture.

Is this correct? John W. Nicholson (talk) 18:44, 12 April 2014 (UTC)


 * I have reworded it somewhat. Deltahedron (talk) 19:46, 12 April 2014 (UTC)

Upper bounds?
Under the section Upper bounds, I am trying to understand why the comments starting with "In 2005, Daniel Goldston, János Pintz and Cem Yıldırım proved that ...." and going to the end of the section should be in Upper bounds and not Lower bounds? I hope you do notice that all of these comments use lim inf. Can this be explained better or moved? 11:45, 24 December 2015 (UTC)


 * Without seeing their proof, I cannot comment on why lim inf is used. But it is not mathematically incorrect to say something like that is an upper bound. Lim inf produces some value. Whatever it is, it is the smallest the expression reaches at its limit. The claim is that this value is an upper limit to a prime gap. Im not sure what your confusion is, except to suggest that you learn more about limits. 2602:306:3780:200:2B:FB03:74D1:5380 (talk) 23:28, 6 August 2017 (UTC)

In this section (Upper Bound) a reference is made to the Baker, Harman, Pintz 2000 article indicating that theta was reduced to 0.525. The use of theta in BHP2000 states that for large enough x there is at least one prime between x - x^theta and x. This is not the same as a statement/proof about the theta in the asymptotic estimate (x^theta)/ln(x)for the number of primes from x to x + x^theta that is the subject of this section. While it is probably that a proof can be developed to show this, it is not a simple task and at this time no such proof has been discovered. Therefore, the 7/12 constant referenced earlier in this section is still the current best known proven estimate of theta in the context of the asymptotic count of prime numbers between x and x + x^theta being referenced in this section. The 0.525 constant is a conjecture, not a current best proven estimate. — Preceding unsigned comment added by 130.76.96.144 (talk) 15:29, 28 August 2018 (UTC)

Lower Bounds?
Should the last part of Upper Bounds which starts with "In 2005, Daniel Goldston, János Pintz and Cem Yıldırım proved that" be moved to Lower Bounds? John W. Nicholson (talk) 03:49, 29 November 2016 (UTC)

Why is a prime gap always even when a gap begins and ends with an even number?
Simple observations states all prime gaps are even, obviously this must be right but not sure why. Is there a special definition/convention?

A simple observation is all gaps began and end with a number that is a factor of the prime number 2, therefore every gap is odd.

The first gap larger then one, is where the prime number 3 has a factor that is odd being 9. Embed between the evens 8,9,10. The article says this gap is 2 between 7 and 11. Isn't it three? What arbitrary perspective counts this as a gap of 2?

Likewise the first gap of size of 4: is 24,25,26,27,28 is five, but is labelled as 4.

The definition of a prime gap as I understand is a list of whole numbers in a row that can be factored. Prime, factor, factor, factor, factor, factor etc, prime. I'm confused and sure other readers are too, the article should explain this.

Also have an issue with article stating the first and only odd gap is between 1,2,3. These numbers cannot be factored and thus there is no prime gap here. '''The article states the first gap is odd and rest are even. Not sure how 1,2,3 are part of the gap count, as these numbers are prime numbers.'''  The first gap is the first number that can be factored, which is the whole number 4 with a gap of 1.

Thanks. --Prime minister 1009 (talk) 18:34, 14 July 2017 (UTC)


 * I think the definition at the start of the article is clear. The first gap of 4 is between primes 7 and 11, because 11-7 = 4. The gap that covers composite numbers 24,25,26,27,28 is 6, between primes 23 and 29, because 29-23=6. The only odd gap is between 2 and 3, which are both primes, and 3-2=1 is odd. Gap9551 (talk) 18:42, 14 July 2017 (UTC)

Conjectures on Gaps
I think the section discussing prime gaps is horribly written, poorly worded, and above all, whoever wrote it didnt adequately understand the material as they were writing it. FACT: its pretty easy to find counter examples to the gap "conjectures" using simple Python scripts. The inequalities are frequently violated within the appropriate domain, and sometimes they are applicable in slightly wider domains. Frankly the bulk of the content is crap. 2602:306:3780:200:2B:FB03:74D1:5380 (talk) 23:23, 6 August 2017 (UTC)
 * Can you be more specific like "Conjecture X fails for n=y"? PrimeHunter (talk) 23:48, 6 August 2017 (UTC)
 * Do I really need to enumerate each and every word thats incorrect when I clearly said "the bulk of it is crap"?! By that logic I could just copy and paste the entire section, and what would be the point in that?  Feel free to examine it yourself. 2602:306:3780:200:2B:FB03:74D1:5380 (talk) 17:03, 7 August 2017 (UTC)
 * How about one single error, then? --JBL (talk) 17:12, 7 August 2017 (UTC)
 * Yes please. I have examined some of it without finding obvious errors. If you can point out one error then I'm willing to examine more. PrimeHunter (talk) 20:19, 7 August 2017 (UTC)


 * Wrt this diff, maybe http://arxiv.org/abs/1604.03496v2 referencing isn't too bad anymore, and/or suited as a reference for some of the already mentioned (+ not already mentioned) conjectures? –178.24.246.213 (talk) 10:14, 12 November 2017 (UTC)

Why isn't the "jumping champions" conjecture mentioned? The conjecture (stating that most frequent gap sizes up to x are 4 and the primorials) is notable enough to deserve a separate page in MathWorld - but not even a mention here? See http://mathworld.wolfram.com/JumpingChampion.html
 * I agree. Billymac00 (talk) 02:38, 27 June 2022 (UTC)

New section?
Should the statements below the dashed line be placed in a separate section from "Upper bounds"? I ask because these statements don't imply anything with an upper bound, instead, they imply something with the lower bound count. If I am wrong, can some statement be placed in the article which makes this use clear with the upper bounds? ---

In 2005, Daniel Goldston, János Pintz and Cem Yıldırım proved that
 * $$\liminf_{n\to\infty}\frac{g_n}{\log p_n}=0$$

and 2 years later improved this to
 * $$\liminf_{n\to\infty}\frac{g_n}{\sqrt{\log p_n}(\log\log p_n)^2}<\infty.$$

In 2013, Yitang Zhang proved that
 * $$\liminf_{n\to\infty} g_n < 7\cdot 10^7,$$

meaning that there are infinitely many gaps that do not exceed 70 million. A Polymath Project collaborative effort to optimize Zhang’s bound managed to lower the bound to 4680 on July 20, 2013. 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. Using Maynard's ideas, the Polymath project improved the bound to 246; assuming the Elliott–Halberstam conjecture and its generalized form, N has been reduced to 12 and 6, respectively. — Preceding unsigned comment added by Reddwarf2956 (talk • contribs)


 * I cannot understand: is there a conjecture (or, maybe, that is a trivial fact) that gaps could be enorm. large and, in fact, they could not have any certain bound? (in other words: some gap could be as large as you wish). --Tamtam90 (talk) 22:47, 6 January 2018 (UTC)

Possible larger maximal prime gaps
First occurrence prime gaps has two 20-digit first known occurrence prime gaps listed that might be large enough to be maximal. They are:

gap = 1530  C?C   Bertil Nyman  2014   m = 34.52     20 decimal digits 17678654157568190587 upper prime 17678654157568189057 lower prime

gap = 1550  C?C   Bertil Nyman  2014   m = 34.94     20 decimal digits 18361375334787048247 upper prime 18361375334787046697 lower prime

C = conventional gap; ? = first known occurrence; C = confirmed bounding primes

(Last updated 0800 GMT 03 January 2018.)

These gaps are near the lower edge of the expected range of possible maximal gaps. As they are quite a bit beyond the search limit, they could easily be pushed aside by others. They might be maximal with additional intermediate maximal gaps.

agb — Preceding unsigned comment added by 173.233.167.63 (talk) 19:45, 6 January 2018 (UTC) '
 * While they might be maximal gaps, they are not currently. At the current rate of progress, the exhaustive search by the PGS group will cover these by mid-2018, answering conclusively.  Is there a pressing need to show the speculation?  DAJ NT (talk) 09:45, 7 January 2018 (UTC)
 * Not "pressing", but might be helpful. That is why I put it only on the Talk page.  I am not requesting that it be added to the main article, which I could do myself if I thought it was that important.  Someone interested in maximal prime gaps might not have run across this information or its source.  Note that as no one knows any formula for the locations of maximal prime gaps then studying the empirical patterns is one possible way to guess a formula.  As the search is painfully slow and requires access to a modern very fast machine (which many people don't), such information just might help someone solve the problem.  Also, the "Prime Gap Searches project at the Mersenne Forum" seems to be merely a somewhat haphazard collection of hundreds of blogs without any overall chart of progress (such as what ToS had for the Goldbach's Conjecture search).  If they do have such a chart then they need to put it more prominently on their site.  agb  — Preceding unsigned comment added by 173.233.167.63 (talk) 18:49, 9 January 2018 (UTC)


 * I am thinking this is starting to get unmanagable. Which implies that a different table or tables should be made. I am thinking Smallest Ten Maximal Gaps and Largest Ten Known Maximal Gaps.

John W. Nicholson (talk) 14:37, 26 February 2018 (UTC)
 * My opinion is this isn't yet too much, as these are primary data points and the rate they're added is fairly slow. For severe data hoarding, see Fermat pseudoprime, Euler–Jacobi pseudoprime, and some related pages -- I got tired of fighting to remove the cruft and just let all those random tables get in the way of the article.  Culling big lists early isn't a bad thing if we can reference a source instead.  Since the OEIS links give us all the data, I'm ok with trimming it if you think it's best.  DAJ NT (talk) 20:40, 27 February 2018 (UTC)
 * There is a lot of interest in the growth and limits of maximal gaps, and a lot of computation was used to find this data. I think we should keep the full list of known maximal gaps. It fits on around a single normal screen and only three have been found since 2006. It may not become unmanagable for centuries if computers continue to improve at current rates. PrimeHunter (talk) 22:33, 27 February 2018 (UTC)
 * As an example of the interest, https://scholar.google.com/scholar?q=1693182318746371 currently shows 27 hits on a maximal gap found in 1999. PrimeHunter (talk) 22:48, 27 February 2018 (UTC)

Out of place paragraph
Immediately after the maximal gap table in "Numerical results" is a paragraph starting: "In 1931, E. Westzynthius proved that maximal prime gaps grow more than logarithmically."...

This should be in the next section "Further results", but I am not sure just where it should go. Perhaps at the very start of "Lower bounds", but someone who is more sure should decide.

agb
 * I agree it should be moved and "Further results" seems to make the most sense, but am also not sure where. DAJ NT (talk) 00:22, 27 January 2018 (UTC)
 * In lower bounds, before Rankin's result, which supercedes this one. —David Eppstein (talk) 02:28, 27 January 2018 (UTC)

Incorrect numbers in numerical results section
In row 30 of "The 77 known maximal prime gaps" these 4 numbers appear

30; 	282; 	436,273,009; 	32,162,398;

The last (4th) number is incorrect. The correct number is 23,162,398. Note the transposition of digits.

It is also likely that the 4th number of row 65 is incorrect.

65; 	1,184; 	43,841,547,845,541,059; 	1,175,662,926,421,598;

There appears to be an error in the 6th or 7th significant figure, although I can't compute the correct answer -- the numbers are just too big.

My method was to subtract the logarithmic integral up to the n'th prime (column 3) from n (column 4) and plot this difference (the ordinate) versus the row number in the table (column 1). The above two errors stand out dramatically as spikes in this plot.

108.20.242.117 (talk) 02:07, 3 February 2018 (UTC)
 * Well spotted. http://primes.utm.edu/nthprime/index.php#piofx says pi(436,273,009) = 23,163,298, so 32,162,398 has multiple errors. I haven't checked the other values but I guess A005669 is correct. The linked https://oeis.org/A005669/b005669.txt says 65 1175661926421598. PrimeHunter (talk) 02:55, 3 February 2018 (UTC)
 * I have checked all values now and there were no other differences from A005669. I have made the corrections.[//en.wikipedia.org/w/index.php?title=Prime_gap&diff=823802156&oldid=823018133] Thanks. PrimeHunter (talk) 14:26, 3 February 2018 (UTC)

Slowing of search
First occurrence prime gaps points out that the search limit for maximal prime gaps has reached up to 2^64, and that this is the limit for programs using hardware register calculations. From now on, programs will be forced to use software calculations, which can be expected to slow the search "by one or two orders of magnitude".

Using the data in the time list, one might guess (if the current rate were to continue) that it could be 10 to 15 years before 10^20 is fully checked. The slowing would imply that it might be hundreds of years.

Since there average just over 4 maximal prime gaps per power of 10 number size, the new rate might be about 1 new maximal gap per 50 or more years.

Also, looking at other lists on the trnicely site, it is noticed that there are NO first occurrence prime gaps with either 21 or 22 digit primes. Maybe the hardware\software calculation problem affects the choice of where to look for large prime gaps.

Some of us wish there would be an improvement in hardware.

agb — Preceding unsigned comment added by 173.233.167.63 (talk) 22:43, 25 August 2018 (UTC)

Source Site Down
Thomas Ray Nicely died September 11, 2019.

His internet site (trnicely.net) stayed up through November, but is defunct now. That site was the main source for news about prime gaps.

Is anyone planning to take over the dissemination of prime gap results?

In particular, the files allgaps.dat and merits.zip need to be kept updated, perhaps quarterly, at least annually, and made available at least on an ftp internet site.

The main problem would be in the checking of new gaps. A modern fast multicore machine would probably be needed.

If someone does this then please add a date code to the filename, perhaps merit201.zip and algap201.dat for the first ones in the year 2020. That way someone would not accidently overwrite older data.

If there is already another internet site with this information, then what is the URL?

agb — Preceding unsigned comment added by 143.43.144.168 (talk) 19:32, 10 December 2019 (UTC)
 * The last version of trnicely.net is mirrored at https://faculty.lynchburg.edu/~nicely/. https://gjhiggins.github.io/ is apparently planning to continue the record keeping. PrimeHunter (talk) 01:02, 11 December 2019 (UTC)

Prime gap averages
I conjectured that the sum of all partial sums (Pn+Pn+2-2Pn)/2.=0 as n increases. I tested this sum for primes up to 9,973 and found the sum to be zero. As a example, P7=17, P8=19, P9=23, the partial sum is +1. Since I cannot find this in this talk I am curious to know if this has been observed before. — Preceding unsigned comment added by 70.19.60.34 (talk) 02:19, 9 May 2020 (UTC) Stanley Kravitz, Ph.D. — Preceding unsigned comment added by 70.19.60.34 (talk) 02:23, 9 May 2020 (UTC)
 * This talk page is for discussing improvements to the article. General questions about mathematics can be asked at Reference desk/Mathematics. Your formula is unclear to me (it reduces to the constant 1 if taken literally) so I don't know what you are asking. PrimeHunter (talk) 14:40, 9 May 2020 (UTC)

Oops: I understand your interpretation and thanks for pointing out an error in the formula. Pn is the nth prime, Pn+1 is the next prime, Pn+2 is the next prime. The corrected formula is (Pn+(Pn+2)-2(Pn+1))/2 where Pn is for example 17, +(Pn+2) is 23, and -2(Pn+1) i.e -2x19=-38. The total is 2 this divided by 2 is the partial sum 1. If all partial sums are added the total appears to be zero. — Preceding unsigned comment added by 70.19.60.34 (talk)
 * Every prime from P3 is added once when it's Pn+2, subtracted twice when it's Pn+1, and added once when it's Pn. This cancels out. If n goes from 1 to m then the only primes which don't cancel out are P1, P2, Pm+1, Pm+2. The total sum becomes (P1-P2-(Pm+1)+(Pm+2))/2, where P1-P2 = 2-3 = -1. Prime gaps after 3 are even so the sum is never an integer. PrimeHunter (talk) 17:26, 9 May 2020 (UTC)

Asked due to curiosity on how the graph of prime vs gap size is plotted.
I was fascinated by the graph plotted in the section "Conjectures about gaps between primes". May I know how the graph was plotted? Thank you😊 ISHANBULLS (talk) 13:17, 9 May 2020 (UTC)
 * commons:File:Wikipedia primegaps.png says "Excel diagram of relation between primegaps and primes", but that description is from the original 2011 version. The current 2013 version has the upload comment: "New version created with data from English-language Wikipedia. Own work. Created with OpenOffice.org Calc. Theoretical curves (parabolae) show maximal gaps according to conjectures due to Cramér (g = (log p)^2), to Cramér-Granville (g = 2exp(-γ)(lo...". It was made by User:Jeppesn who can be contacted at User talk:Jeppesn, or may reply here. He only has two edits since 2018. PrimeHunter (talk) 14:37, 9 May 2020 (UTC)

Simple observations section
"For any integer n, the factorial n! is the product of all positive integers up to and including n. Then in the sequence n! + 2, n! + 3 , … , n! + n the first term is divisible by 2, the second term is divisible by 3, and so on."

Is this correct? E.g., for n = 2, the second term (2! + 3 = 5) isn't divisible by 3. --Ex-prodigy (talk) 03:47, 7 July 2020 (UTC)
 * The last term in the mentioned sequence is n! + n. For n = 2 this is 2! + 2, so there is no second term 2! + 3. It's standard math language to speak of the second term or more in a sequence which may be shorter in some cases. There is no need to change the formulation, and doing so would be unnecessarily clumsy. The sequence can also be empty for n = 1. PrimeHunter (talk) 09:27, 7 July 2020 (UTC)

(n+1)-th or (n+1)st?
these both appear in the article.--142.163.195.46 (talk) 20:59, 27 May 2021 (UTC)

Does it peak at multiples of 3 or 6?
It seems that the figure peaks at multiples of 3 and not 6, and yet my modifications is reverted! Please have a look.

https://en.wikipedia.org/w/index.php?title=Prime_gap&diff=1168585045&oldid=1168575199 Mehdiabbasi (talk) 18:51, 3 August 2023 (UTC)


 * Note that the bars are at 2, 4, 6, ..., not 1, 2, 3, .... - CRGreathouse (t | c) 14:17, 4 August 2023 (UTC)