Edited by humans. Written by AI. How our editing works
All articles

Why Gaps Between Prime Numbers Have No Upper Limit

A factorial proof creates arbitrarily long prime-free runs, but finding the earliest examples and estimating gaps near huge numbers remain difficult problems.

Priya Sharma

Written by AI. Priya Sharma

September 17, 20266 min read
Share:
Numberphile graphic with bold “BIGGEST PRIME GAPS” text and a 1831–1847 number line bracketed in red

Photo: AI. Tomoko Hayashi

Prime-free stretches have no maximum length, even though prime numbers themselves continue without end.

Ben Sparks gives the compact version in Numberphile’s treatment of prime gaps: “Any size you like.” That claim is conclusive. The difficult questions begin when we ask where the first gap of a chosen length occurs, how large gaps behave around numbers of a given size, or how far a computer might need to search for the next prime.

A one-line construction proves unlimited gaps. It is also spectacularly inefficient at locating the earliest examples. Number theory often works this way: existence comes cheaply, while location sends the invoice.

Counting the Empty Space

Terminology can create an immediate off-by-one error. The standard prime gap between consecutive primes p and q is q − p, according to the definition summarized by Wikipedia. The number of composite integers strictly between those primes is q − p − 1.

Consider the twin primes 11 and 13. Their standard prime gap is 2, while only one composite number, 12, lies between them.

Sparks chooses to count the non-primes between consecutive primes. That convention makes the construction easier to discuss in plain language, provided everyone states which counter they are using. Apart from the gap between 2 and 3, consecutive primes are odd, so their numerical difference is even. The number of intervening integers is therefore odd.

A run of nine composite numbers corresponds to a standard prime gap of at least 10. It may sit inside a still longer run, so “at least” does some necessary work.

The Factorial Machine

Choose the desired run length n and calculate:

(n + 1)! = 1 × 2 × 3 × ... × (n + 1)

Now inspect these n consecutive integers:

(n + 1)! + 2, (n + 1)! + 3, ..., (n + 1)! + (n + 1)

For each integer k from 2 through n + 1, the factorial (n + 1)! is divisible by k. Adding k preserves that divisibility:

(n + 1)! + k = k(((n + 1)! / k) + 1)

Each number in the sequence consequently has a divisor larger than 1 and smaller than itself. Each is composite.

For n = 9, the starting factorial is:

10! = 3,628,800

The nine integers from 3,628,802 through 3,628,810 are all composite. The first is divisible by 2, the next by 3, and the pattern continues through the final number, which is divisible by 10.

The construction starts at +2 because adding 1 supplies no corresponding divisor. A number of the form (n + 1)! + 1 may be prime or composite; this divisibility argument cannot decide.

Strictly speaking, the construction directly establishes a composite run rather than identifying its two neighboring primes. Because primes occur beyond every fixed point on the number line, some pair of consecutive primes surrounds the run. Their gap must be large enough to contain it. This turns the composite sequence into a proof that prime gaps are unbounded.

A Guaranteed Answer Can Be a Terrible Estimate

Factorials are blunt instruments. Sparks puts the drawback plainly: “Factorials get big real quick.”

The example at 10! begins above 3.6 million, yet a longer composite run appears near the beginning of the number line. The integers from 114 through 126 are all composite, bracketed by the primes 113 and 127. That gives 13 consecutive composites and a standard prime gap of 14.

So the factorial construction places nine guaranteed composites above 3.6 million while ordinary arithmetic supplies 13 of them just above 100. The proof was designed to guarantee a run for every possible n; it was never optimized to find the first one.

This separates two questions that can sound interchangeable:

  1. Can a composite run of any requested length be proved to exist?
  2. Where does the earliest run of that length occur?

The factorial argument settles the first. The second calls for sharper theory, computation, or a mixture of both.

Tables of maximal gaps track first occurrences rather than merely manufacturing distant examples. The Prime Pages, for instance, lists a stretch of 879 composite numbers after the prime 277900416100927. Under the standard convention, that corresponds to a prime gap of 880. Under the composite-counting convention used in the Numberphile discussion, it is a run of 879.

The number is impressive, but its scientific role is more precise than spectacle. A record identifies how early a gap of at least that size has actually appeared within a completed search. It does not provide a formula predicting the next record.

The Quantitative Question is Harder

The factorial proof says nothing useful about the size of a gap relative to its position. An n-long composite run constructed near (n + 1)! arrives at an address that expands far faster than the run itself.

Terence Tao framed the sharper problem in a 2014 discussion of large prime gaps: obtaining lower bounds for large gaps is closely connected to finding long strings of consecutive composite numbers that remain comparatively small relative to their length.

That extra condition changes the character of the problem. The elementary construction proves that arbitrarily long deserts exist somewhere. Quantitative research asks how wide a desert can be around a given scale, and how economically one can force it to appear.

Those questions belong to the broader study of how primes are distributed. Individual numbers obey a crisp rule: either a number has a divisor or it does not. Collections of primes display patterns that resist equally crisp prediction. Unlimited prime gaps coexist with unresolved questions about very small gaps, including whether infinitely many twin-prime pairs exist.

The coexistence causes no contradiction. “Arbitrarily large” means that every proposed bound eventually fails somewhere. It does not mean gaps increase steadily, or that large gaps prevent small ones from appearing farther along.

Searching for the Next Prime

Computers can test successive candidates until they find a prime. The procedure is deterministic: start from a chosen integer, test it, move upward if it is composite, and repeat. In routine cases, this can work well.

A proof of unlimited gaps introduces a worst-case concern. A starting point might land inside a long composite run, forcing the search through every remaining number in that run. The elementary theorem guarantees such hostile neighborhoods at some scales without describing their typical frequency or giving a tight, simple limit for every search.

Sparks characterizes the gap between practice and theory directly: “Mathematically our theoretical understanding of this is pretty poor at the moment.” In context, the remark concerns predicting how long a sequential search may need to continue around extremely large numbers. It does not imply that primality testing itself is mysterious, or that computers usually wander helplessly through million-digit integers.

This distinction between testing and finding matters. A primality test asks whether one selected number is prime. A search asks how many candidates must be examined before a prime appears. The first concerns the cost of evaluating a candidate; the second also depends on the local gap.

The factorial argument can manufacture a prime desert of any requested length. Number theory still has to determine how early such deserts can begin, how wide they can be at a chosen scale, and how long a search must walk before arithmetic becomes hospitable again.

More Like This

A man in a black hoodie gestures toward a mathematical series equation (1 + 1/2 + 1/3 + 1/4... = ∞) with a "SEVEN WAYS!"…

Seven Proofs That the Harmonic Series Diverges

Michael Penn's 31-minute video walks through seven distinct proofs that the harmonic series diverges—from a 1350 grouping trick to a prime-number infinite product.

Nadia Marchetti·3 months ago·6 min read
Neon spiral diagram with concentric circles in cyan and pink, a mathematical curve, and "UNSOLVED?" text on dark background

Decoding the Riemann Hypothesis and Prime Regularity

Explore the Riemann Hypothesis and its implications for the distribution and regularity of prime numbers.

Priya Sharma·5 months ago·3 min read
An elderly man with glasses smiles next to a large game board with red and black chess knight pieces arranged on numbered…

Red & Black Knights: A Chess Math Problem Gone Wild

Neil Sloane and Jonas Karlsson's two-color knight placement problem produces stunning emergent order from brutally simple rules. Here's what actually happens.

Priya Sharma·4 months ago·
Neon glowing text displays "1 SECOND TO FIND 1,000,000,000 PRIMES" over cascading code and numbers with a shocked yellow…

Finding the Billionth Prime in Under One Second

A deep dive into the algorithms and hardware realities behind computing the billionth prime number in under a second—from naive sieves to cache-level optimization.

Amelia Nwofor·4 months ago·7 min read
Bright magenta background with large black text reading "2.685 is EVERYWHERE" and brown text saying "Numberphile" on the…

Khinchin's Constant: The Number Hidden in Most Numbers

Mathematician Richard Elwes explains Khinchin's constant — 2.685 — a number that emerges from almost every irrational number, yet can't be proven for any specific one.

Priya Sharma·4 weeks ago·7 min read
Woman with red and purple hair wearing glasses gestures while explaining palindromic numbers 62 and 26 with directional…

The Maths Behind Palindrome Ages Explained

Mathematician Kat Phillips unpacks why some pairs of people have reversible ages—and the surprisingly elegant number theory that governs when it happens.

Priya Sharma·3 months ago·7 min read
Massive building engulfed in intense flames with water tower visible, overlaid with "STRANGE EVIDENCE" text and Science…

Fire Tornadoes on a Lake: The Bardstown Bourbon Disaster

In 2003, fire tornadoes erupted on a Kentucky lake. The cause wasn't paranormal—it was 800,000 gallons of burning bourbon and the right wind geometry.

Priya Sharma·3 months ago·6 min read
A bright explosion engulfs a city skyline as intense yellow light radiates across the sky, illustrating catastrophic cosmic…

Asteroid Impact on a City: What the Science Actually Shows

A Science Channel scenario imagines an 1,800-ft asteroid striking New York in 2029. Here's what the physics, detection protocols, and real planetary defense infrastructure say.

Priya Sharma·3 months ago·8 min read