{
  "id": "3399",
  "ident": "NS.03399",
  "slug": "erdos-852",
  "title": "Erdős Problem 852",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $d_n = p_{n+1} - p_n$, where $p_n$ is the $n$th prime. Let $h(x)$ be maximal such that for\nsome $n < x$ the numbers $d_n, d_{n+1}, \\ldots, d_{n+h(x)-1}$ are all distinct [Er85c]. Estimate\n$h(x)$. In particular, is it true that\n$$h(x) > (\\log x)^c$$\nfor some constant $c > 0$?\n\nThe statement avoids defining $h$. Since $h(x)$ is the longest such run, $h(x) > y$ holds exactly\nwhen some $n < x$ starts a run of $H > y$ distinct gaps. We state the question this way, with $x$\nreal. We read it as asking for one $c > 0$ such that the inequality holds for all large $x$.\n\nThe primes are indexed from $p_0 = 2$, as in `primeGap`. Shifting the index by one does not change\nthe question.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos852.erdos_852.parts.i",
  "statement_lean": "theorem erdos_852.parts.i :\n    ∃ c : ℝ, 0 < c ∧ ∀ᶠ x : ℝ in atTop,\n      ∃ n : ℕ, (n : ℝ) < x ∧ ∃ H : ℕ, (Real.log x) ^ c < (H : ℝ) ∧ DistinctGapRun n H",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 852\n\n*References:*\n- [erdosproblems.com/852](https://www.erdosproblems.com/852)\n- [Er85c] Erdős, P., *On some of my problems in number theory I would most like to see solved*.\n  Number theory (Ootacamund, 1984) (1985), 74-84.\n- [A001223](https://oeis.org/A001223)\n- [A053597](https://oeis.org/A053597)\n- [A078515](https://oeis.org/A078515)\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos852\n\n/-- The $H$ prime gaps $d_n, d_{n+1}, \\ldots, d_{n+H-1}$ are pairwise distinct.\n\nHere $d_n = p_{n+1} - p_n$ is `primeGap n`, so the primes are indexed from $p_0 = 2$. The empty run\n$H = 0$ and every run with $H = 1$ are distinct. -/\ndef DistinctGapRun (n H : ℕ) : Prop :=\n  Set.InjOn primeGap (Set.Ico n (n + H))\n\n/-- The gaps $d_0, d_1 = 1, 2$ are distinct. -/\n@[category test, AMS 11]\ntheorem distinctGapRun_zero_two : DistinctGapRun 0 2 := by\n  have h0 : primeGap 0 = 1 := by simp [primeGap]\n  have h1 : primeGap 1 = 2 := by simp [primeGap]\n  intro a ha b hb hab\n  simp only [Set.mem_Ico] at ha hb\n  have ha' : a = 0 ∨ a = 1 := by omega\n  have hb' : b = 0 ∨ b = 1 := by omega\n  rcases ha' with rfl | rfl <;> rcases hb' with rfl | rfl <;> omega\n\n/-- The gaps $d_0, d_1, d_2 = 1, 2, 2$ are not distinct. -/\n@[category test, AMS 11]\ntheorem not_distinctGapRun_zero_three : ¬ DistinctGapRun 0 3 := by\n  have h1 : primeGap 1 = 2 := by simp [primeGap]\n  have h2 : primeGap 2 = 2 := by simp [primeGap]\n  intro h\n  have := h (show (1 : ℕ) ∈ Set.Ico 0 (0 + 3) by simp) (show (2 : ℕ) ∈ Set.Ico 0 (0 + 3) by simp)\n    (h1.trans h2.symm)\n  omega\n\n/--\nLet $d_n = p_{n+1} - p_n$, where $p_n$ is the $n$th prime. Let $h(x)$ be maximal such that for\nsome $n < x$ the numbers $d_n, d_{n+1}, \\ldots, d_{n+h(x)-1}$ are all distinct [Er85c]. Estimate\n$h(x)$. In particular, is it true that\n$$h(x) > (\\log x)^c$$\nfor some constant $c > 0$?\n\nThe statement avoids defining $h$. Since $h(x)$ is the longest such run, $h(x) > y$ holds exactly\nwhen some $n < x$ starts a run of $H > y$ distinct gaps. We state the question this way, with $x$\nreal. We read it as asking for one $c > 0$ such that the inequality holds for all large $x$.\n\nThe primes are indexed from $p_0 = 2$, as in `primeGap`. Shifting the index by one does not change\nthe question.\n-/\n@[category research open, question, AMS 11]\ntheorem erdos_852.parts.i :\n    ∃ c : ℝ, 0 < c ∧ ∀ᶠ x : ℝ in atTop,\n      ∃ n : ℕ, (n : ℝ) < x ∧ ∃ H : ℕ, (Real.log x) ^ c < (H : ℝ) ∧ DistinctGapRun n H := by\n  sorry\n\n/--\nLet $d_n = p_{n+1} - p_n$, where $p_n$ is the $n$th prime. Let $h(x)$ be maximal such that for\nsome $n < x$ the numbers $d_n, d_{n+1}, \\ldots, d_{n+h(x)-1}$ are all distinct [Er85c]. Estimate\n$h(x)$. In particular, is it true that\n$$h(x) = o(\\log x)?$$\n\nThe statement avoids defining $h$. It says that for every $\\varepsilon > 0$ and all large real $x$,\nevery run of $H$ distinct gaps $d_n, \\ldots, d_{n+H-1}$ with $n < x$ satisfies\n$H \\leq \\varepsilon \\log x$. This is $h(x) \\leq \\varepsilon \\log x$, because $h(x)$ is the longest\nsuch run.\n\nThe indexing is as in `Erdos852.erdos_852.parts.i`.\n-/\n@[category research open, question, AMS 11]\ntheorem erdos_852.parts.ii :\n    ∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℝ in atTop,\n      ∀ n : ℕ, (n : ℝ) < x → ∀ H : ℕ, DistinctGapRun n H → (H : ℝ) ≤ ε * Real.log x := by\n  sorry\n\n/--\nBrun's sieve implies $h(x) \\to \\infty$ as $x \\to \\infty$ (remark on\n[erdosproblems.com/852](https://www.erdosproblems.com/852)).\n\nThat is, for every $H$ and all large $x$ there is some $n < x$ such that $d_n, \\ldots, d_{n+H-1}$\nare all distinct. Since more values of $n$ are allowed as $x$ grows, this holds exactly when, for\nevery $H$, some $n$ has $d_n, \\ldots, d_{n+H-1}$ all distinct.\n\nThis also follows from `Erdos6.erdos_6.variants.increasing`, because strictly increasing prime\ngaps are distinct.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_852.variants.tendsto_atTop :\n    ∀ H : ℕ, ∀ᶠ x : ℝ in atTop, ∃ n : ℕ, (n : ℝ) < x ∧ DistinctGapRun n H := by\n  sorry\n\nend Erdos852\n",
  "statement_hash": "353cedfaea2d48edc7d2b1ce05422762feaeb3f1555a0fd30512327592468eba",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}