---
title: Maximal Prime Gaps
url: https://www.emergentmind.com/topics/maximal-prime-gaps
type: topic
---

# Maximal Prime Gaps

A maximal prime gap is a record-setting interval between two consecutive primes: for the ordered primes $p_n$, the gap $g_n = p_{n+1} - p_n$ is maximal if $g_n > g_i$ for all $i < n$. The study of maximal prime gaps probes the interface between the regularity described by the Prime Number Theorem and the unpredictable variability in the distribution of primes. It plays a central role in analytic and probabilistic number theory, connecting to extreme value statistics, sieve theory, the Riemann hypothesis, and deep conjectures such as Cramér, Granville, and the Hardy–Littlewood $k$-tuple conjecture.

## 1. Fundamental Definitions and Classical Results

Let $p_1 = 2,\, p_2 = 3,\, \dots$ denote the primes in order, and define the $n$th prime gap $g_n := p_{n+1} - p_n$. A gap $g_n$ is said to be a **maximal prime gap** (or "record gap") if $g_n > \max_{1 \leq k < n} g_k$. Let $G(x) := \max\{ p_{n+1} - p_n : p_n \leq x \}$ be the largest gap among all consecutive primes up to $x$. The $k$-th record gap appears at index $n_k^*$ and is denoted $g_k^* = g_{n_k^*}$.

Historically, the maximal prime gap function $G(x)$ has attracted interest due to its connection with the subtler irregularities in the prime sequence, beyond the average spacing predicted by the Prime Number Theorem. The earliest unconditional result, due to Westzynthius (1931), established that $G(x) / \log x \to \infty$ as $x \to \infty$ [1408.4505]. Erdős (1935), Rankin (1938), and subsequent works provided quantitative lower bounds, while Cramér (1936) conjectured the correct upper order of growth.

## 2. Conjectures and Heuristic Laws: Cramér, Shanks, and Granville

### Cramér–Shanks Conjecture

Cramér’s probabilistic model, based on treating primes as random with the correct density, leads to the conjecture:
\[
G(x) \sim (\log x)^2 \quad\text{as }x\to\infty,
\]
or equivalently, for prime index $n$, $G_n := \max_{j \leq n} (p_{j+1} - p_j) \sim (\log n)^2$ [2405.16019, 1309.4053]. This is the *Cramér–Shanks law*.

### Granville’s Refinement

Granville’s analysis, using more realistic models of prime distribution, predicts that the limsup of scaled record gaps exceeds the Cramér constant:
\[
\limsup_{x\to\infty} \frac{G(x)}{2e^{-\gamma} (\log x)^2} > 1, \quad 2e^{-\gamma} \approx 1.1229
\]
where $\gamma$ is Euler–Mascheroni [2405.16019, 1908.08613].

### Explicit Growth and Moment Heuristics

Heuristics based on the statistics of rare events suggest for the $k$th power moments of gaps,
\[
\frac{1}{n}\sum_{j=1}^{n} (p_{j+1} - p_j)^k \sim k! (\log n)^k,
\]
which ties directly to the exponential model for gaps and leads back to the predicted quadratic-logarithmic behavior for maximal gaps [2405.16019].

## 3. Rigorous Bounds: Unconditional, Conditional, and Sieve Methods

### Unconditional Upper Bounds

The best-known unconditional bound for all large $n$ is due to Wang, who proves
\[
p_{n+1} - p_n \leq 2 (\log p_n)^2
\]
for all $n\geq 5$ [2510.17065]. This confirms the quadratic-log order conjectured by Cramér, up to the explicit constant $2$:
\[
G(x) \leq 2 (\log x)^2 \quad \text{for } x \geq 11.
\]
Earlier, Carella established for any $\varepsilon > 0$,
\[
p_{n+1} - p_n \leq C_\varepsilon (\log p_n)^{1+\varepsilon}
\]
for large enough $n$ [1312.2481], but the sharpest unconditional exponent currently achievable is $2$.

### Conditional Bounds (Riemann Hypothesis)

Assuming RH, improved bounds are possible. Carella proved [1008.2381]
\[
G(x) = O\left( \frac{(\log x)^2}{\log\log x} \right),
\]
while Carneiro, Milinovich, and Soundararajan obtained the explicit RH-bound [1708.04122]
\[
p_{n+1} - p_n \leq \frac{22}{25} \sqrt{p_n}\, \log p_n.
\]
These RH results represent the current state-of-the-art for all $x$ and connect prime gap questions to properties of $\zeta(s)$-zeros via explicit formulae.

### Unconditional Lower Bounds

Ford, Green, Konyagin, Maynard, and Tao showed that for arbitrarily large $X$, there exist gaps
\[
G(X) \geq f(X) \frac{\log X\, \log \log X\, \log \log \log \log X}{(\log \log \log X)^2}
\]
with $f(X)\to\infty$ as $X\to\infty$ [1408.4505]. No unconditional construction produces gaps of order as large as $(\log X)^2$—the gap between known lower and upper bounds remains substantial.

## 4. Probabilistic and Extreme-Value Models

### Cramér’s Model and the Gumbel Law

In the Cramér random model—where each $n$ independently has probability $1/\log n$ of being "prime"—the distribution of maximal gaps converges, after centering and scaling, to the Gumbel distribution [1401.6959, 1301.2242]:
\[
\lim_{n\to\infty} \mathbf{P}\left( \frac{G_n - b_n}{a_n} \leq z \right) = \exp( -e^{-z} )
\]
with parameters $a_n \sim \log n$ and $b_n \sim (\log n)\log(n/\log n) \sim (\log n)^2 - (\log n)\log\log n$. This is strongly supported numerically for actual primes [1901.03785, 1301.2242].

### Refined Trend Formulas

Numerical and heuristic arguments (Wolf–Shanks–Kourbatov–Oliveira e Silva) refine the basic $(\log x)^2$ trend:
\[
G(x) \sim \log^2 x - 2 \log x \log\log x + c \log x
\]
with $c \approx 0.2778769$ (from the twin prime constant) [1102.0481, 1901.03785]. Numerical data up to $4 \times 10^{18}$ confirm this trend within error of $O(\log x)$, and no maximal gap has ever exceeded $2e^{-\gamma}(\log x)^2$ except in a handful of low and large $n$ exceptions [2405.16019].

## 5. Record Data, Verification, and Empirical Landscape

Extensive computations tabulate all record gaps up to $x \approx 10^{18}$. Visser utilized the 81 known record gaps to verify three sharper conjectured bounds (Firoozbakht, Nicholson, Farhadian) for all $p < 2^{64}$ ($\sim 1.84 \times 10^{19}$) [1904.00499]. Empirical record gaps always remain beneath the $(\log x)^2$ curve, with the ratio $G(x)/(\log x)^2 \to 1$ from below, but with rare excursions above the Granville threshold [2405.16019, 1309.4053].

### Sample of Early Maximal Gaps

| $p_n$  | $p_{n+1}$ | $G(p_n)$ | $(\log p_n)^2$ |
|-------:|----------:|----------:|----------------:|
| 2      | 3         |      1    | 0.48            |
| 3      | 5         |      2    | 1.21            |
| 7      | 11        |      4    | 3.79            |
| 113    | 127       |     14    | 22.35           |
| 887    | 907       |     20    | 46.08           |
| ...    | ...       |    ...    | ...             |

## 6. Maximal Gaps in Progressions, Residue Classes, and $k$-tuplets

The maximal gap framework extends to primes in arithmetic progressions and to prime $k$-tuples. For residue class $q,a$, maximal gaps almost always satisfy $G_{q,a}(x) < \varphi(q) (\log x)^2$; in general, the empirical trend is [1610.03340, 1809.09579]
\[
G_{q,a}(x) \sim \varphi(q) (\log x)^2,
\]
with rare exceptions. Analogous extreme-value and Gumbel statistics appear for general $k$-tuplets, with the mean gap scaling as $O(\log^k x)$ and maximal gaps as $O(\log^{k+1} x)$ [1301.2242, 1401.6959].

## 7. Open Problems and Future Directions

Despite substantial progress, a rigorous proof of the Cramér–Shanks law $G(x) = O((\log x)^2)$ remains elusive. The scale separation between current unconditional lower and upper bounds persists. Conditional improvements via RH are stagnated at $\mathcal{O}( (\log x)^2 / \log\log x )$ [1008.2381]. On the computational side, faster sieves and large dataset runs have verified all conjectured upper bounds for primes $<2^{64}$ [2012.03771, 1904.00499]. It remains an open question whether the limiting distribution of maximal gaps, when appropriately standardized, is truly Gumbel for the true prime sequence; this is currently known only in random and model settings [1401.6959, 1901.03785]. The precise limsup of $G(x)/(\log x)^2$ is unknown, but data and heuristic models suggest Granville's threshold is exceeded only extremely rarely. Further progress likely requires new ideas in sieve theory, prime tuples, or the analytic theory of L-functions.

---

**Key references**: [1102.0481], [1309.4053], [1708.04122], [2510.17065], [1408.4505], [1901.03785], [1610.03340], [2012.03771], [2405.16019], [1401.6959], [1312.2481], [1008.2381], [1301.2242], [1010.3945], [1908.08613], [1809.09579], [1511.04468], [1904.00499]

Source: https://www.emergentmind.com/topics/maximal-prime-gaps