{
  "id": "1427",
  "ident": "NS.01427",
  "slug": "erdos-240",
  "title": "Erdős Problem 240",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Is there an infinite set of primes $P$ such that if $\\{a_1<a_2<\\cdots\\}$ is the set of integers\ndivisible only by primes in $P$ then $\\lim a_{i+1}-a_i=\\infty$?\n\nThe answer is yes, proved by Tijdeman [Ti73, Theorem 7]. The question was asked to Erdős by\nWintner [Er65b, p. 218]. See also Erdős Problem 368.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos240.erdos_240",
  "statement_lean": "theorem erdos_240 :\n    ∃ P : Set ℕ, P.Infinite ∧ P ⊆ {p : ℕ | p.Prime} ∧\n      Tendsto (fun i ↦ a P (i + 1) - a P i) atTop atTop",
  "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\npublic import FormalConjectures.ErdosProblems.«675»\n\n/-!\n# Erdős Problem 240\n\n*References:*\n- [erdosproblems.com/240](https://www.erdosproblems.com/240)\n- [Er65b] Erdős, Paul, *Some recent advances and current problems in number theory*. Lectures on\n  Modern Mathematics, Vol. III (1965), 196-244.\n  [PDF](https://www.renyi.hu/~p_erdos/1965-17.pdf)\n- [Po18] Pólya, Georg, *Zur arithmetischen Untersuchung der Polynome*. Math. Z. (1918), 143-148.\n- [Ti73] Tijdeman, R., *On integers with many small prime factors*. Compositio Math. 26 (1973),\n  319-330. [numdam](https://www.numdam.org/item/CM_1973__26_3_319_0/)\n-/\n\n@[expose] public section\n\nopen Filter Asymptotics\n\nnamespace Erdos240\n\n/-- `a P i` is the `i`-th smallest element of `Erdos675.composedOf P`, the positive integers all\nof whose prime factors lie in `P`, counting from index `0`. So `a P 0 = 1` (the site writes\n$a_1<a_2<\\cdots$).\n\nFor a nonempty set `P` of primes, `composedOf P` is infinite, `a P` is strictly increasing and the\nnatural-number subtractions below are exact. If `P` contains no prime, then `composedOf P = {1}`\nand `a P i = 0` for `i ≥ 1` (the junk value of `Nat.nth`); the statements below exclude this. -/\nnoncomputable def a (P : Set ℕ) (i : ℕ) : ℕ :=\n  Nat.nth (· ∈ Erdos675.composedOf P) i\n\nset_option linter.style.formal_proof_palomar false in\n/--\nIs there an infinite set of primes $P$ such that if $\\{a_1<a_2<\\cdots\\}$ is the set of integers\ndivisible only by primes in $P$ then $\\lim a_{i+1}-a_i=\\infty$?\n\nThe answer is yes, proved by Tijdeman [Ti73, Theorem 7]. The question was asked to Erdős by\nWintner [Er65b, p. 218]. See also Erdős Problem 368.\n-/\n@[category research solved, question, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos240.lean#L1817\"]\ntheorem erdos_240 :\n    ∃ P : Set ℕ, P.Infinite ∧ P ⊆ {p : ℕ | p.Prime} ∧\n      Tendsto (fun i ↦ a P (i + 1) - a P i) atTop atTop := by\n  sorry\n\n/--\nTijdeman [Ti73] resolved this question, proving that, for any $\\epsilon>0$, there exists an\ninfinite set of primes $P$ such that, with $a_i$ defined as above,\n$$a_{i+1}-a_i \\gg a_i^{1-\\epsilon}.$$\n([Ti73, Theorem 7] is stated for $0<\\epsilon<1$; for $\\epsilon\\geq 1$ the bound is trivial.)\n-/\n@[category research solved, AMS 11]\ntheorem erdos_240.variants.tijdeman_epsilon (ε : ℝ) (hε : 0 < ε) :\n    ∃ P : Set ℕ, P.Infinite ∧ P ⊆ {p : ℕ | p.Prime} ∧\n      (fun i ↦ (a P i : ℝ) ^ (1 - ε)) =O[atTop] (fun i ↦ ((a P (i + 1) - a P i : ℕ) : ℝ)) := by\n  sorry\n\n/--\nThe limit is infinite for a finite set of primes, which follows from a theorem of Pólya [Po18],\nthat if $f(n)$ is a quadratic integer polynomial without repeated roots then as\n$n\\to \\infty$ the largest prime factor of $f(n)$ also approaches infinity.\nErdős [Er65b, p. 218] also credits this to Pólya.\n\nHere $P$ is nonempty: for $P=\\emptyset$ the set of integers is $\\{1\\}$ and there are no gaps.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_240.variants.finite {P : Set ℕ} (hP : P.Finite) (hne : P.Nonempty)\n    (hpr : P ⊆ {p : ℕ | p.Prime}) :\n    Tendsto (fun i ↦ a P (i + 1) - a P i) atTop atTop := by\n  sorry\n\n/--\nTijdeman [Ti73] proved that, if $P$ is a finite set of primes, then\n$$a_{i+1}-a_i \\gg \\frac{a_i}{(\\log a_i)^C}$$\nfor some constant $C>0$ depending on $P$.\n\n[Ti73, Theorem 1 and its Corollary] state this for the integers composed of all primes at most\n$p$; it follows for every finite set of primes, since a subset of these integers has larger gaps.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_240.variants.tijdeman_finite {P : Set ℕ} (hP : P.Finite) (hne : P.Nonempty)\n    (hpr : P ⊆ {p : ℕ | p.Prime}) :\n    ∃ C : ℝ, 0 < C ∧\n      (fun i ↦ (a P i : ℝ) / Real.log (a P i : ℝ) ^ C) =O[atTop]\n        (fun i ↦ ((a P (i + 1) - a P i : ℕ) : ℝ)) := by\n  sorry\n\nend Erdos240\n",
  "statement_hash": "4476aa0659bdde2037bde3d56c111a3ff5319f95cbb4d09414c2fab4bb16016c",
  "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."
}