/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
module
public import FormalConjecturesUtilErdős Problem 968
Let uₙ = pₙ / n, where pₙ is the nth prime. Does the set of n such that uₙ < uₙ₊₁
have positive lower density?
Erdős and Prachar also proved that ∑_{pₙ < x} |uₙ₊₁ - uₙ| ≍ (log x)^2, and that the set of n
such that uₙ > uₙ₊₁ has positive lower density. Erdős also asked whether there are infinitely many
increasing triples uₙ < uₙ₊₁ < uₙ₊₂ or decreasing triples uₙ > uₙ₊₁ > uₙ₊₂.
Reference: erdosproblems.com/968
[ErPr61] Erdős, P. and Prachar, K., Sätze und Probleme über pₖ/k. Abh. Math. Sem. Univ. Hamburg (1961/62), 251–256.
[FMT18] Ford, K. and Maynard, J. and Tao, T., Chains of large gaps between primes. Irregularities in the distribution of prime numbers, Springer (2018), 1–21.
[Ma15] Maynard, J., Small gaps between primes. Ann. of Math. (2015), 383–413.
[OAI26a] OpenAI, Positive lower density of large prime gaps. OpenAI Math Release preprint (2026). https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/preprints/Positive-lower-density-of-large-prime-gaps-September-25-2026/main.pdf
@[expose] public sectionopen Filter Realopen scoped BigOperatorsnamespace Erdos968
u n is the normalized nth prime, defined as pₙ / (n+1) where pₙ is the nth prime
(with 0.nth Nat.Prime = 2).
This corresponds to the classical sequence (p₁/1, p₂/2, p₃/3, ...) while using Nat.nth Prime's
0-based indexing; in particular, the denominator is always positive.
noncomputable def u (n : ℕ) : ℝ :=
(n.nth Nat.Prime : ℝ) / (n + 1)
Does the set {n | u n < u (n+1)} have positive lower density?
Yes. This was proved by an internal OpenAI model in September 2026 [OAI26a]; see the linked Lean proof.
@[category research solved, question, AMS 11, formal_proof using lean4 at
"https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/NumberTheory/PrimeGaps/RatioCorollary.lean#L30"]
theorem erdos_968 : 0 < {n : ℕ | u n < u (n + 1)}.lowerDensity := ⊢ 0 < {n | u n < u (n + 1)}.lowerDensity
All goals completed! 🐙
Erdős and Prachar proved ∑_{pₙ < x} |u (n+1) - u n| ≍ (log x)^2 (see [ErPr61]).
We encode ∑_{pₙ < x} as a sum over n < Nat.primeCounting' x (the number of primes < x).
@[category research solved, AMS 11]
theorem erdos_968.variants.sum_abs_diff_isTheta_log_sq :
(fun x : ℕ =>
∑ n < Nat.primeCounting' x, |u (n + 1) - u n|) =Θ[atTop]
fun x : ℕ => log x ^ 2 := ⊢ (fun x ↦ ∑ n < x.primeCounting', |u (n + 1) - u n|) =Θ[atTop] fun x ↦ log ↑x ^ 2
All goals completed! 🐙
Erdős and Prachar proved that the set {n | u n > u (n+1)} has positive lower density
(see [ErPr61]).
@[category research solved, AMS 11]
theorem erdos_968.variants.decreasing_steps_pos_lower_density :
0 < {n : ℕ | u n > u (n + 1)}.lowerDensity := ⊢ 0 < {n | u n > u (n + 1)}.lowerDensity
All goals completed! 🐙
Erdős asked whether there are infinitely many solutions to uₙ < uₙ₊₁ < uₙ₊₂.
The answer is yes. Since uₙ < uₙ₊₁ is equivalent to pₙ₊₁ - pₙ > pₙ / n, it suffices to have
infinitely many n with two consecutive prime gaps larger than pₙ / n ∼ log n. Ford, Maynard,
and Tao [FMT18] proved that for every fixed k there are infinitely many n with k consecutive
prime gaps all of size ≫ log pₙ · log log pₙ · log log log log pₙ / log log log pₙ.
@[category research solved, question, AMS 11]
theorem erdos_968.variants.infinite_increasingTriples :
{n : ℕ | u n < u (n + 1) ∧ u (n + 1) < u (n + 2)}.Infinite := ⊢ {n | u n < u (n + 1) ∧ u (n + 1) < u (n + 2)}.Infinite
All goals completed! 🐙
Erdős asked whether there are infinitely many solutions to uₙ > uₙ₊₁ > uₙ₊₂.
The answer is yes. Since uₙ > uₙ₊₁ is equivalent to pₙ₊₁ - pₙ < pₙ / n, it suffices to have
infinitely many n with pₙ₊₂ - pₙ bounded, because pₙ / n → ∞. Maynard [Ma15] proved that
liminf (pₙ₊₂ - pₙ) < ∞.
@[category research solved, question, AMS 11]
theorem erdos_968.variants.infinite_decreasingTriples :
{n : ℕ | u n > u (n + 1) ∧ u (n + 1) > u (n + 2)}.Infinite := ⊢ {n | u n > u (n + 1) ∧ u (n + 1) > u (n + 2)}.Infinite
All goals completed! 🐙end Erdos968