# Is it known what the maximum interval between prime numbers is?

**URL:** <https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918>\
**Category:** Factual Questions\
**Created:** [September 3, 2013, 8:10pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918 "2013-09-03T20:10:34Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skald\_the\_Rhymer](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Skald\_the\_Rhymer](https://boards.straightdope.com/u/Skald_the_Rhymer)\
**Post date:** [September 3, 2013, 8:10pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/1 "2013-09-03T20:10:34Z")

</div>

When I’m doing my daily run, I frequently amuse myself by mentally determining the prime factorization of any three or four digit number I see. Doing so this morning got me thinking about prime numbers in general and made me wonder something.

I think most of us know Euclid’s proof that there are [infinitely many prime numbers](http://en.wikipedia.org/wiki/Euclid's_theorem). It seems to me that that argument, and others like it, can be described as proving that number of integers between any given prime and the next larger one can never be infinite; it it were, the first integer would be the largest prime. Assuming I’m write about that (and I could easily be wrong), I wonder if there’s any way of calculating the maximum space (i.e., number of integers) between prime numbers.

Anybody know?

---

<div class="post-metadata">

**Author:** ![Lubricious\_Integument](https://avatars.discourse-cdn.com/v4/letter/l/82dd89/32.png) [@Lubricious\_Integument](https://boards.straightdope.com/u/Lubricious_Integument)\
**Post date:** [September 3, 2013, 8:13pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/2 "2013-09-03T20:13:05Z")

</div>

There is no largest gap. The number (n+1)! +1 is followed by n composite numbers.

---

<div class="post-metadata">

**Author:** ![Skald\_the\_Rhymer](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@Skald\_the\_Rhymer](https://boards.straightdope.com/u/Skald_the_Rhymer)\
**Post date:** [September 3, 2013, 8:16pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/3 "2013-09-03T20:16:19Z")

</div>

> [@Lubricious\_Integument](#):
>
> There is no largest gap. The number (n+1)! +1 is followed by n composite numbers.

Can you supply a proof, either here or via link?

---

<div class="post-metadata">

**Author:** ![Lubricious\_Integument](https://avatars.discourse-cdn.com/v4/letter/l/82dd89/32.png) [@Lubricious\_Integument](https://boards.straightdope.com/u/Lubricious_Integument)\
**Post date:** [September 3, 2013, 8:22pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/4 "2013-09-03T20:22:08Z")

</div>

> [@Skald\_the\_Rhymer](#):
>
> Can you supply a proof, either here or via link?

Sure.

(n+1)! + 2 is a multiple of 2.  
(n+1)! + 3 is a multiple of 3.  
(n+1)! + 4 is a multiple of 4.

And so on, until…

(n+1)! + (n+1) is a multiple of (n+1).

---

<div class="post-metadata">

**Author:** ![MikeS](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@MikeS](https://boards.straightdope.com/u/MikeS)\
**Post date:** [September 3, 2013, 8:55pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/5 "2013-09-03T20:55:15Z")

</div>

Note that the above proof (which is very nice) doesn’t give you a sequence of exactly n composite numbers, bounded on each end by primes; it just gives you a sequence of _at least_ n composite numbers for any n. Which is sufficient to show that no largest gap exists, of course.

It’s also known that the primes become rarer and rarer as you go to higher and higher integers; specifically, the probability that a given integer near N is prime is proportional to 1/ln(N) for sufficiently large N, which goes to zero as N goes to infinity. (I’m glossing over a bunch of formal definitions here, of course.) If there was a maximum gap between consecutive primes (call this number G), one would expect that this probability would instead approach 1/G as N went to infinity, rather than approaching zero.

---

<div class="post-metadata">

**Author:** ![Folacin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/folacin/32/3195_2.png) [@Folacin](https://boards.straightdope.com/u/Folacin)\
**Post date:** [September 3, 2013, 9:09pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/6 "2013-09-03T21:09:53Z")

</div>

> [@MikeS](#):
>
> It’s also known that the primes become rarer and rarer as you go to higher and higher integers; specifically, the probability that a given integer near N is prime is proportional to 1/ln(N) for sufficiently large N, which goes to zero as N goes to infinity. (I’m glossing over a bunch of formal definitions here, of course.) If there was a maximum gap between consecutive primes (call this number G), one would expect that this probability would instead approach 1/G as N went to infinity, rather than approaching zero.

I’m almost positive that there is some (really, really large number) after which primes start to become more common. I mostly remember that because it seems impossible.

---

<div class="post-metadata">

**Author:** ![The\_Lurker\_Above](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@The\_Lurker\_Above](https://boards.straightdope.com/u/The_Lurker_Above)\
**Post date:** [September 3, 2013, 9:10pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/7 "2013-09-03T21:10:46Z")

</div>

> [@Skald\_the\_Rhymer](#):
>
> I wonder if there’s any way of calculating the maximum space (i.e., number of integers) between prime numbers.
> 
> Anybody know?

A rececnt [Numberphile](http://www.youtube.com/watch?v=l8ezziaEeNE&feature=c4-overview&list=UUoxcjq-8xIDTYp3uz647V5A) video talks about this.

Apparently for n\>100 there will always be a prime between n and 1.2n.

---

<div class="post-metadata">

**Author:** ![Blaster\_Master](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Blaster\_Master](https://boards.straightdope.com/u/Blaster_Master)\
**Post date:** [September 3, 2013, 9:19pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/8 "2013-09-03T21:19:06Z")

</div>

Not directly related, but there was a recent paper I heard about, IIRC, there being an infinite number of paired primes no farther apart than 70,000,000 and can possibly be reduced significantly, maybe even being a path to proving the twin prime conjecture. Supposedly, since that paper was released they’ve already worked it down a lot. Not sure how much the OP is interested in this, but still cool stuff nonetheless.

Here’s a link to an article that covers the paper. I’m not sure how up to date it is.

> **[Unheralded Mathematician Bridges the Prime Gap | Quanta Magazine](https://www.quantamagazine.org/yitang-zhang-proves-landmark-theorem-in-distribution-of-prime-numbers-20130519/)**
>
> A virtually unknown researcher has made a great advance in one of mathematics’ oldest problems, the twin primes conjecture.

ETA: Numberphile is awesome. I think that might even be where I heard about this paper.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [September 3, 2013, 10:01pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/9 "2013-09-03T22:01:28Z")

</div>

> [@The\_Lurker\_Above](#):
>
> A rececnt [Numberphile](http://www.youtube.com/watch?v=l8ezziaEeNE&feature=c4-overview&list=UUoxcjq-8xIDTYp3uz647V5A) video talks about this.
> 
> Apparently for n\>100 there will always be a prime between n and 1.2n.

I didn’t know that (the n \> 100 part although it is plausible), but the following is true: For all epsilon \> 0, there is an N such that n \> N implies there is always a prime between n and n\*(1+\epsilon). So the above claim is that when epsilon = 0.2, you can take N = 100. Finally, I cannot leave this thread without quoting the couplet that Nat Fine gave us when I took number theory 56 years ago and I have not been able to forget.

Chebychev proved it, you can too  
There’s always a prime 'tween n and n times 2.

---

<div class="post-metadata">

**Author:** ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)\
**Post date:** [September 3, 2013, 11:28pm UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/10 "2013-09-03T23:28:18Z")

</div>

> [@Lubricious\_Integument](#):
>
> Sure.
> 
> (n+1)! + 2 is a multiple of 2.  
> (n+1)! + 3 is a multiple of 3.  
> (n+1)! + 4 is a multiple of 4.
> 
> And so on, until…
> 
> (n+1)! + (n+1) is a multiple of (n+1).

Nice. But you could use LCM(2,3,…,(n+1)) instead of (n+1)! and demonstrate the existence of such a sequence at a (generally) much smaller integer.

---

<div class="post-metadata">

**Author:** ![coffeecat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/coffeecat/32/3405_2.png) [@coffeecat](https://boards.straightdope.com/u/coffeecat)\
**Post date:** [September 4, 2013, 12:21am UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/11 "2013-09-04T00:21:10Z")

</div>

> [@Hari\_Seldon](#):
>
> Chebychev proved it, you can too  
> There’s always a prime 'tween n and n times 2.

n=1  
n=0 😛

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [September 4, 2013, 1:09am UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/12 "2013-09-04T01:09:24Z")

</div>

Incidentally, you can prove that trivially from Goldbach’s conjecture. Which isn’t much use since the n\<p\<2n thing is actually proven and Goldbach’s conjecture isn’t, but there you go.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [September 4, 2013, 5:47am UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/13 "2013-09-04T05:47:54Z")

</div>

> [@yabob](#):
>
> Nice. But you could use LCM(2,3,…,(n+1)) instead of (n+1)! and demonstrate the existence of such a sequence at a (generally) much smaller integer.

If all you’re trying to show is existence, it doesn’t matter.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [September 4, 2013, 11:19am UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/14 "2013-09-04T11:19:04Z")

</div>

> [@coffeecat](#):
>
> n=1  
> n=0 😛

Poetic license. Also, 0 is excluded since factorization is essentially about positive integers and there is a prime between 1 and 2 for some value of “between”.🙂

---

<div class="post-metadata">

**Author:** ![Itself](https://avatars.discourse-cdn.com/v4/letter/i/d07c76/32.png) [@Itself](https://boards.straightdope.com/u/Itself)\
**Post date:** [September 4, 2013, 11:26am UTC](https://boards.straightdope.com/t/is-it-known-what-the-maximum-interval-between-prime-numbers-is/667918/15 "2013-09-04T11:26:52Z")

</div>

The average distance between from a prime p to the next prime is unbounded by the argument already given above, but its “average” value is ~log p by the prime number theorem (where “average” requires more effort to define than I’m putting in at the moment). The primes are also “evenly distributed” (same caveat as above) modulo an arbitrary prime, so that the “average” (scare-quotes yet again) distance from a prime p to the next prime that’s equal to N mod q (for N != 0 mod q) is about ~(q-1)log p for a fixed prime q. There are extensive results on the distribution of primes, prime gaps, twin and similar primes, etc. It’s a huge field, but it’s not my field, so I’ll stop here.
