{
  "id": "1942",
  "ident": "NS.01942",
  "slug": "erdos-382",
  "title": "Erdős Problem 382",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $u \\leq v$ be such that the largest prime dividing $\\prod_{u \\leq m \\leq v} m$ appears with\nexponent at least $2$. Is it true that $v - u = v^{o(1)}$?\n\nWe read this as: for every $\\epsilon > 0$, every such pair with $v$ large enough satisfies\n$v - u \\leq v^{\\epsilon}$. Cambie observed that this question reduces to old conjectures on gaps\nbetween primes; for example, it follows from Cramér's conjecture. See also Erdős Problems 380 and\n383.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos382.erdos_382.parts.i",
  "statement_lean": "theorem erdos_382.parts.i :\n    ∀ ε > (0 : ℝ), ∀ᶠ v : ℕ in atTop, ∀ u : ℕ, LargestPrimeRepeated u v →\n      ((v - u : ℕ) : ℝ) ≤ (v : ℝ) ^ ε",
  "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 382\n\n*References:*\n- [erdosproblems.com/382](https://www.erdosproblems.com/382)\n- [ErGr80] Erdős, P. and Graham, R., *Old and new problems and results in combinatorial number\n  theory*. Monographies de L'Enseignement Mathematique (1980).\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos382\n\n/-- `LargestPrimeRepeated u v` means that $1 \\leq u \\leq v$ and the largest prime $p$ dividing\n$\\prod_{u \\leq m \\leq v} m$ appears in it with exponent at least $2$, that is $p^2$ divides the\nproduct.\n\nWe require $u \\geq 1$, since for $u = 0$ the product is $0$ and `Nat.maxPrimeFac 0 = 0`. We also\nrequire $v \\geq 2$: the only other pair is $u = v = 1$, where the product is $1$, which has no\nprime factor, and the junk value `Nat.maxPrimeFac 1 = 1` would make the condition hold. -/\ndef LargestPrimeRepeated (u v : ℕ) : Prop :=\n  1 ≤ u ∧ u ≤ v ∧ 2 ≤ v ∧\n    Nat.maxPrimeFac (∏ m ∈ Finset.Icc u v, m) ^ 2 ∣ ∏ m ∈ Finset.Icc u v, m\n\n/-- The pair $(48, 50)$ satisfies the condition: $48 \\cdot 49 \\cdot 50 = 2^5 \\cdot 3 \\cdot 5^2\n\\cdot 7^2$, and the largest prime $7$ appears with exponent $2$. -/\n@[category test, AMS 11]\ntheorem largestPrimeRepeated_48_50 : LargestPrimeRepeated 48 50 := by\n  unfold LargestPrimeRepeated\n  decide +kernel\n\n/-- If the condition holds, then $v < 2u$.\n\nOtherwise $2u \\leq v$, and by Bertrand's postulate there is a prime $q$ with $v/2 < q \\leq v$, so\n$u \\leq q \\leq v$. The largest prime $p$ of the product satisfies $p \\geq q > v/2$. Hence $p$\ndivides exactly one factor $m \\in [u, v]$, namely $m = p$, and $p$ appears with exponent $1$. -/\n@[category textbook, AMS 11]\ntheorem lt_two_mul_of_largestPrimeRepeated {u v : ℕ} (h : LargestPrimeRepeated u v) :\n    v < 2 * u := by\n  obtain ⟨hu, -, hv, hdvd⟩ := h\n  by_contra! hle\n  have hP0 : ∏ m ∈ Finset.Icc u v, m ≠ 0 :=\n    Finset.prod_ne_zero_iff.2 fun m hm ↦ by have := (Finset.mem_Icc.1 hm).1; omega\n  -- Bertrand's postulate gives a prime `q` with `v / 2 < q ≤ v`, so `u ≤ q ≤ v`.\n  obtain ⟨q, hq, hq1, hq2⟩ := Nat.exists_prime_lt_and_le_two_mul (v / 2) (by omega)\n  have hqP : q ∣ ∏ m ∈ Finset.Icc u v, m :=\n    Finset.dvd_prod_of_mem _ (Finset.mem_Icc.2 ⟨by omega, by omega⟩)\n  have hP1 : 1 < ∏ m ∈ Finset.Icc u v, m :=\n    lt_of_lt_of_le hq.one_lt (Nat.le_of_dvd (Nat.pos_of_ne_zero hP0) hqP)\n  -- The largest prime factor `p` satisfies `q ≤ p`, so `v < 2 * p`.\n  set p := Nat.maxPrimeFac (∏ m ∈ Finset.Icc u v, m)\n  have hp : p.Prime := Nat.prime_maxPrimeFac_of_one_lt _ hP1\n  have hpq : q ≤ p := Nat.le_maxPrimeFac hP0 hq hqP\n  have hv2 : v < 2 * p := by omega\n  -- Hence `p` is the only multiple of `p` in `[u, v]`.\n  have key : ∀ m ∈ Finset.Icc u v, p ∣ m → m = p := by\n    rintro m hm ⟨k, rfl⟩\n    have hm' := Finset.mem_Icc.1 hm\n    rcases Nat.lt_or_ge k 2 with hk | hk\n    · interval_cases k <;> omega\n    · have := Nat.mul_le_mul_left p hk\n      linarith [hm'.2]\n  have hpmem : p ∈ Finset.Icc u v := by\n    obtain ⟨m, hm, hpm⟩ := (Prime.dvd_finsetProd_iff hp.prime _).1\n      (Nat.maxPrimeFac_dvd (n := ∏ m ∈ Finset.Icc u v, m))\n    rwa [← key m hm hpm]\n  -- Write the product as `p * R`. Then `p ^ 2` divides it only if `p ∣ R`, which is impossible.\n  rw [← Finset.mul_prod_erase _ _ hpmem, pow_two] at hdvd\n  obtain ⟨m, hm, hpm⟩ := (Prime.dvd_finsetProd_iff hp.prime _).1\n    ((mul_dvd_mul_iff_left hp.ne_zero).1 hdvd)\n  exact (Finset.mem_erase.1 hm).1 (key m (Finset.mem_of_mem_erase hm) hpm)\n\n/--\nLet $u \\leq v$ be such that the largest prime dividing $\\prod_{u \\leq m \\leq v} m$ appears with\nexponent at least $2$. Is it true that $v - u = v^{o(1)}$?\n\nWe read this as: for every $\\epsilon > 0$, every such pair with $v$ large enough satisfies\n$v - u \\leq v^{\\epsilon}$. Cambie observed that this question reduces to old conjectures on gaps\nbetween primes; for example, it follows from Cramér's conjecture. See also Erdős Problems 380 and\n383.\n-/\n@[category research open, question, AMS 11]\ntheorem erdos_382.parts.i :\n    ∀ ε > (0 : ℝ), ∀ᶠ v : ℕ in atTop, ∀ u : ℕ, LargestPrimeRepeated u v →\n      ((v - u : ℕ) : ℝ) ≤ (v : ℝ) ^ ε := by\n  sorry\n\n/--\nLet $u \\leq v$ be such that the largest prime dividing $\\prod_{u \\leq m \\leq v} m$ appears with\nexponent at least $2$. Can $v - u$ be arbitrarily large?\n\nThat is, for every $k$, is there such a pair with $v - u \\geq k$? Cambie gives a heuristic that\nsuggests the answer is yes.\n-/\n@[category research open, question, AMS 11]\ntheorem erdos_382.parts.ii :\n    ∀ k : ℕ, ∃ u v : ℕ, LargestPrimeRepeated u v ∧ k ≤ v - u := by\n  sorry\n\n/--\nErdős and Graham [ErGr80] report that it follows from results of Ramachandra that\n$v - u \\leq v^{1/2+o(1)}$ for every pair $u \\leq v$ as in `Erdos382.erdos_382.parts.i`.\n\nThat is, for every $\\epsilon > 0$, every such pair with $v$ large enough satisfies\n$v - u \\leq v^{1/2+\\epsilon}$.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_382.variants.ramachandra :\n    ∀ ε > (0 : ℝ), ∀ᶠ v : ℕ in atTop, ∀ u : ℕ, LargestPrimeRepeated u v →\n      ((v - u : ℕ) : ℝ) ≤ (v : ℝ) ^ ((1 : ℝ) / 2 + ε) := by\n  sorry\n\nend Erdos382\n",
  "statement_hash": "25bc124939f86c01572e4009156ac8a705ecdf26879905925d79a2756b198dc8",
  "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."
}