Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Erdős Problem 854

Source:Erdős Problems
Open problem Nobody knows the answer yet — neither on paper nor in Lean. First verified proof: +100 points.
Statement:reviewed
Statement:

Let nkn_k denote the kkth primorial, i.e. the product of the first kk primes.

If 1=a1<a2<⋯<aϕ(nk)=nk−11=a_1<a_2<\cdots <a_{\phi(n_k)}=n_k-1 is the sequence of integers coprime to nkn_k, then estimate the smallest even integer not of the form ai+1−aia_{i+1}-a_i. Are there ≫max⁡i(ai+1−ai)\gg \max_i (a_{i+1}-a_i) many even integers of the form aj+1−aja_{j+1}-a_j?

This is the first part. A problem of Erdős [Er85c, p. 80], who writes "integer" instead of "even integer"; all differences ai+1−aia_{i+1}-a_i are even, so only even integers are meaningful. Here "estimate" is read as Θ\Theta. Erdős first thought that for large kk every even $t \leq \max_i(a_{i+1}-a_i)$ is a gap, but [Ob1] reports computations of Lacampagne and Selfridge showing this fails for n6=30030n_6 = 30030 (OEIS A389839 and A048670 give 2020 and 2222).

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:question
Cite as:NS.03405 [math.NT] · NS.03405v1 for this version
Declaration:Erdos854.erdos_854.parts.i
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 100, later ones: 10; accepted critique: up to 60
Statement hash:67be9458c1991774e6d340ac24cfe8396aba953272b3dc1a559b904d19561f53
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/854.lean

Formal statement

theorem erdos_854.parts.i :
    (fun k ↦ (minEvenNonGap k : ℝ)) =Θ[atTop] erdos_854.parts.i.answer
Show the full Challenge.lean (112 lines) — definitions included
module

public import FormalConjecturesUtil
public import FormalConjectures.ErdosProblems.«235»

/-!
# Erdős Problem 854

*References:*
- [erdosproblems.com/854](https://www.erdosproblems.com/854)
- [Er85c] Erdős, P., *On some of my problems in number theory I would most like to see solved*.
  Number theory (Ootacamund, 1984), Lecture Notes in Math. 1122 (1985), 74-84.
  [PDF](https://www.renyi.hu/~p_erdos/1985-17.pdf)
- [Ob1] Erdős, P., *Oberwolfach Mathematical Problems*, Volume 1. Mathematisches
  Forschungsinstitut Oberwolfach.
- [OEIS A389839](https://oeis.org/A389839): smallest even number which cannot be written as the
  difference of two consecutive numbers which are relatively prime to the $n$th primorial. It
  agrees with `minEvenNonGap k` for $k\geq 3$.
- [OEIS A048670](https://oeis.org/A048670): Jacobsthal's function of the product of the first $n$
  primes, which is the largest gap.
-/

@[expose] public section

open Filter Asymptotics

namespace Erdos854

/-- The $k$th primorial $n_k = p_1 \cdots p_k$, the product of the first $k$ primes
(`Nat.nth Nat.Prime i` is the $(i+1)$st prime, counting from $i = 0$). In particular $n_0 = 1$. -/
noncomputable def kthPrimorial (k : ℕ) : ℕ :=
  ∏ i ∈ Finset.range k, Nat.nth Nat.Prime i

/-- `gapSet m` is the set of values of $a_{i+1} - a_i$, where $a_1 < a_2 < \cdots$ are the
integers in $[1, m)$ coprime to $m$ (for $m > 1$). It is the set of entries of `Erdos235.gaps m`,
the differences of consecutive entries of the sorted list of integers below `m` coprime to `m`. -/
def gapSet (m : ℕ) : Finset ℕ :=
  (Erdos235.gaps m).toFinset

/-- `maxGap m` is $\max_i (a_{i+1} - a_i)$ for the integers in $[1, m)$ coprime to `m`, and `0`
if there are no gaps. For $m = n_k$ with $k\geq 2$ this is the Jacobsthal function of $m$. -/
def maxGap (m : ℕ) : ℕ :=
  (gapSet m).sup id

/-- $f(k)$: the smallest positive even integer that is not of the form $a_{i+1} - a_i$ for the
integers $a_1 < a_2 < \cdots$ in $[1, n_k)$ coprime to $n_k$. The condition `0 < t` is needed
since $0$ is not a gap. For $k \geq 1$ the set contains $n_k$ itself (even, and larger than every
gap), so `sInf` is a true minimum. -/
noncomputable def minEvenNonGap (k : ℕ) : ℕ :=
  sInf {t : ℕ | 0 < t ∧ Even t ∧ t ∉ gapSet (kthPrimorial k)}

/-- The third primorial is $2 \cdot 3 \cdot 5 = 30$. -/
@[category test, AMS 11]
theorem kthPrimorial_three : kthPrimorial 3 = 30 := by
  simp [kthPrimorial, Finset.prod_range_succ, Nat.nth_prime_zero_eq_two,
    Nat.nth_prime_one_eq_three, Nat.nth_prime_two_eq_five]

def erdos_854.parts.i.answer : ℕ → ℝ := sorry

/--
Let $n_k$ denote the $k$th primorial, i.e. the product of the first $k$ primes.

If $1=a_1<a_2<\cdots <a_{\phi(n_k)}=n_k-1$ is the sequence of integers coprime to $n_k$, then
estimate the smallest even integer not of the form $a_{i+1}-a_i$. Are there
$$\gg \max_i (a_{i+1}-a_i)$$
many even integers of the form $a_{j+1}-a_j$?

This is the first part. A problem of Erdős [Er85c, p. 80], who writes "integer" instead of "even
integer"; all differences $a_{i+1}-a_i$ are even, so only even integers are meaningful. Here
"estimate" is read as $\Theta$. Erdős first thought that for large $k$ every even $t \leq
\max_i(a_{i+1}-a_i)$ is a gap, but [Ob1] reports computations of Lacampagne and Selfridge showing
this fails for $n_6 = 30030$ (OEIS A389839 and A048670 give $20$ and $22$).
-/
@[category research open, question value, AMS 11]
theorem erdos_854.parts.i :
    (fun k ↦ (minEvenNonGap k : ℝ)) =Θ[atTop] erdos_854.parts.i.answer := by
  sorry

/--
Let $n_k$ denote the $k$th primorial, i.e. the product of the first $k$ primes.

If $1=a_1<a_2<\cdots <a_{\phi(n_k)}=n_k-1$ is the sequence of integers coprime to $n_k$, then
estimate the smallest even integer not of the form $a_{i+1}-a_i$. Are there
$$\gg \max_i (a_{i+1}-a_i)$$
many even integers of the form $a_{j+1}-a_j$?

This is the second part. We read it as: there is an absolute constant $c > 0$ such that, for all
large $k$, the number of distinct gap values is at least $c$ times the largest gap.
-/
@[category research open, question, AMS 11]
theorem erdos_854.parts.ii :
    ∃ c > (0 : ℝ), ∀ᶠ k : ℕ in atTop,
      c * (maxGap (kthPrimorial k) : ℝ) ≤ ((gapSet (kthPrimorial k)).card : ℝ) := by
  sorry

end Erdos854

To prove it: keep every definition of Challenge.lean unchanged and prove Erdos854.erdos_854.parts.i with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_i : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch erdos-854
nosorry submit erdos-854 nosorry/erdos-854/Solution.lean --wait

Formal variants

Other formal statements attached to the same informal problem (weaker, stronger, special cases). Each is scored separately.

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.