{
  "id": "3864",
  "ident": "NS.03864",
  "slug": "erdos-983",
  "title": "Erdős Problem 983",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $n\\geq 2$ and $\\pi(n)<k\\leq n$. Let $f(k,n)$ be the smallest integer $r$ such that in any\n$A\\subseteq \\{1,\\ldots,n\\}$ of size $\\lvert A\\rvert=k$ there exist primes $p_1,\\ldots,p_r$ such\nthat $>r$ many $a\\in A$ are only divisible by primes from $\\{p_1,\\ldots,p_r\\}$.\n\nIs it true that\n$$2\\pi(n^{1/2})-f(\\pi(n)+1,n)\\to \\infty$$\nas $n\\to \\infty$?\n\nThis is the first part. The primes may depend on $A$. Erdős and Straus conjectured this\n[Er70b, p. 138 and p. 140].\n\nThe answer is no: Liam Price and GPT-5.5 Pro showed on the\n[forum](https://www.erdosproblems.com/forum/thread/983#post-6104) that\n$f(\\pi(n)+1,n)=2\\pi(n^{1/2})+1$ for infinitely many $n$; see the\n[explanation](https://www.erdosproblems.com/forum/thread/983#post-6525) by Nat Sothanaphan.\nWrite $p_k$ for the $k$-th prime. By [Po79, Corollary after Theorem 2.2] there are infinitely\nmany $N$ with $p_{N-i}p_{N+i}<p_N^2$ for $1\\leq i<N$. Take $n=p_N^2-1$, so\n$\\pi(n^{1/2})=N-1$. Let $A$ consist of the products of adjacent primes on the path\n$p_{2N-1},p_1,p_{2N-2},p_2,\\ldots,p_{N+1},p_{N-1},p_N$, its two endpoint primes, and the\nother primes up to $n$. Then $\\lvert A\\rvert=\\pi(n)+1$, and for any $r\\leq 2N-2$ primes at\nmost $r$ elements of $A$ are divisible only by those primes, so $f(\\pi(n)+1,n)\\geq 2N-1$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos983.erdos_983.parts.i",
  "statement_lean": "theorem erdos_983.parts.i :\n    ¬ Tendsto (fun n : ℕ ↦\n      2 * (Nat.primeCounting (Nat.sqrt n) : ℤ) - (f (Nat.primeCounting n + 1) n : ℤ))\n      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\n\n/-!\n# Erdős Problem 983\n\n*References:*\n- [erdosproblems.com/983](https://www.erdosproblems.com/983)\n- [Er70b] Erdős, P., *Some applications of graph theory to number theory*. Proc. Second Chapel\n  Hill Conf. on Combinatorial Mathematics and its Applications (Univ. North Carolina, Chapel\n  Hill, N.C., 1970) (1970), 136-145. [PDF](https://www.renyi.hu/~p_erdos/1970-20.pdf)\n- [Po79] Pomerance, C., *The prime number graph*. Math. Comp. 33 (1979), 399-408.\n  [PDF](https://math.dartmouth.edu/~carlp/PDF/paper19.pdf)\n-/\n\n@[expose] public section\n\nopen Filter Asymptotics\n\nnamespace Erdos983\n\n/-- `numSmooth A S` is the number of elements of `A` all of whose prime factors lie in `S`.\nThe element `1` has no prime factors, so it is counted for every `S`. -/\ndef numSmooth (A S : Finset ℕ) : ℕ :=\n  (A.filter fun a => ∀ p ∈ a.primeFactors, p ∈ S).card\n\n/-- $f(k,n)$ is the least $r$ such that every $A\\subseteq\\{1,\\ldots,n\\}$ with $|A|=k$ has a set\n$S$ of $r$ primes with more than $r$ elements of $A$ divisible only by primes from $S$.\n\nFor $\\pi(n)<k\\leq n$ the value $r=\\pi(n)$ is admissible (take all primes $\\leq n$), so `sInf` is\na minimum. Outside this range `f k n = 0` is a junk value: for $k\\leq\\pi(n)$ no $r$ is\nadmissible, and for $k>n$ every $r$ is. -/\nnoncomputable def f (k n : ℕ) : ℕ :=\n  sInf {r : ℕ | ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 n → A.card = k →\n    ∃ S : Finset ℕ, S.card = r ∧ (∀ p ∈ S, p.Prime) ∧ r < numSmooth A S}\n\n/-- If every `A ⊆ {1, …, n}` of size `k` has a set `S` of `r` primes with more than `r`\nelements of `A` divisible only by primes from `S`, then `f k n ≤ r`. -/\n@[category API, AMS 11]\ntheorem f_le {k n r : ℕ}\n    (h : ∀ A : Finset ℕ, A ⊆ Finset.Icc 1 n → A.card = k →\n      ∃ S : Finset ℕ, S.card = r ∧ (∀ p ∈ S, p.Prime) ∧ r < numSmooth A S) :\n    f k n ≤ r :=\n  Nat.sInf_le h\n\n/--\nLet $n\\geq 2$ and $\\pi(n)<k\\leq n$. Let $f(k,n)$ be the smallest integer $r$ such that in any\n$A\\subseteq \\{1,\\ldots,n\\}$ of size $\\lvert A\\rvert=k$ there exist primes $p_1,\\ldots,p_r$ such\nthat $>r$ many $a\\in A$ are only divisible by primes from $\\{p_1,\\ldots,p_r\\}$.\n\nIs it true that\n$$2\\pi(n^{1/2})-f(\\pi(n)+1,n)\\to \\infty$$\nas $n\\to \\infty$?\n\nThis is the first part. The primes may depend on $A$. Erdős and Straus conjectured this\n[Er70b, p. 138 and p. 140].\n\nThe answer is no: Liam Price and GPT-5.5 Pro showed on the\n[forum](https://www.erdosproblems.com/forum/thread/983#post-6104) that\n$f(\\pi(n)+1,n)=2\\pi(n^{1/2})+1$ for infinitely many $n$; see the\n[explanation](https://www.erdosproblems.com/forum/thread/983#post-6525) by Nat Sothanaphan.\nWrite $p_k$ for the $k$-th prime. By [Po79, Corollary after Theorem 2.2] there are infinitely\nmany $N$ with $p_{N-i}p_{N+i}<p_N^2$ for $1\\leq i<N$. Take $n=p_N^2-1$, so\n$\\pi(n^{1/2})=N-1$. Let $A$ consist of the products of adjacent primes on the path\n$p_{2N-1},p_1,p_{2N-2},p_2,\\ldots,p_{N+1},p_{N-1},p_N$, its two endpoint primes, and the\nother primes up to $n$. Then $\\lvert A\\rvert=\\pi(n)+1$, and for any $r\\leq 2N-2$ primes at\nmost $r$ elements of $A$ are divisible only by those primes, so $f(\\pi(n)+1,n)\\geq 2N-1$.\n-/\n@[category research solved, question, AMS 11]\ntheorem erdos_983.parts.i :\n    ¬ Tendsto (fun n : ℕ ↦\n      2 * (Nat.primeCounting (Nat.sqrt n) : ℤ) - (f (Nat.primeCounting n + 1) n : ℤ))\n      atTop atTop := by\n  sorry\n\ndef erdos_983.parts.ii.answer : ℕ → ℕ → ℝ := sorry\n\n/--\nLet $n\\geq 2$ and $\\pi(n)<k\\leq n$. Let $f(k,n)$ be the smallest integer $r$ such that in any\n$A\\subseteq \\{1,\\ldots,n\\}$ of size $\\lvert A\\rvert=k$ there exist primes $p_1,\\ldots,p_r$ such\nthat $>r$ many $a\\in A$ are only divisible by primes from $\\{p_1,\\ldots,p_r\\}$.\n\nIn general, estimate $f(k,n)$, particularly when $\\pi(n)+1<k=o(n)$.\n\nThis is the second part. We read \"estimate\" as an asymptotic formula `answer k n`, valid for\nevery function $k=k(n)$ with $\\pi(n)+1<k(n)=o(n)$.\n-/\n@[category research open, question value, AMS 11]\ntheorem erdos_983.parts.ii :\n    ∀ k : ℕ → ℕ, (∀ᶠ n : ℕ in atTop, Nat.primeCounting n + 1 < k n) →\n      ((fun n : ℕ ↦ (k n : ℝ)) =o[atTop] (fun n : ℕ ↦ (n : ℝ))) →\n      (fun n : ℕ ↦ (f (k n) n : ℝ)) ~[atTop]\n        (fun n : ℕ ↦ erdos_983.parts.ii.answer (k n) n) := by\n  sorry\n\n/--\nIt is trivial that $f(k,n)\\leq \\pi(n)$ [Er70b, p. 138]. Here $\\pi(n)<k$.\n-/\n@[category textbook, AMS 11]\ntheorem erdos_983.variants.le_primeCounting {k n : ℕ} (hk : Nat.primeCounting n < k) :\n    f k n ≤ Nat.primeCounting n := by\n  -- Take `S` to be the set of all primes `≤ n`: every element of `A` is then `S`-smooth.\n  refine f_le fun A hA hAk => ⟨(Finset.range (n + 1)).filter Nat.Prime, ?_, ?_, ?_⟩\n  · simp [Nat.primeCounting, Nat.primeCounting', Nat.count_eq_card_filter_range]\n  · exact fun p hp => (Finset.mem_filter.mp hp).2\n  · have hAll : A.filter (fun a => ∀ p ∈ a.primeFactors,\n        p ∈ (Finset.range (n + 1)).filter Nat.Prime) = A := by\n      refine Finset.filter_true_of_mem fun a ha p hp => ?_\n      have ha' := Finset.mem_Icc.mp (hA ha)\n      have hp' := Nat.mem_primeFactors.mp hp\n      have hpa : p ≤ a := Nat.le_of_dvd (by omega) hp'.2.1\n      exact Finset.mem_filter.mpr ⟨Finset.mem_range.mpr (by omega), hp'.1⟩\n    rw [numSmooth, hAll, hAk]\n    exact hk\n\n/--\nErdős and Straus [Er70b, p. 139, (14)] proved\n$$f(\\pi(n)+1,n)\\leq 2\\pi(n^{1/2})+1.$$\n-/\n@[category research solved, AMS 11]\ntheorem erdos_983.variants.upper_bound (n : ℕ) :\n    f (Nat.primeCounting n + 1) n ≤ 2 * Nat.primeCounting (Nat.sqrt n) + 1 := by\n  sorry\n\n/--\nErdős and Straus proved [Er70b, pp. 138-140] that\n$$f(\\pi(n)+1,n)=2\\pi(n^{1/2})+o_A\\left(\\frac{n^{1/2}}{(\\log n)^A}\\right)$$\nfor any $A>0$.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_983.variants.erdos_straus :\n    ∀ A : ℝ, 0 < A →\n      (fun n : ℕ ↦ (f (Nat.primeCounting n + 1) n : ℝ) -\n          2 * (Nat.primeCounting (Nat.sqrt n) : ℝ)) =o[atTop]\n        (fun n : ℕ ↦ Real.sqrt n / Real.log n ^ A) := by\n  sorry\n\nend Erdos983\n",
  "statement_hash": "14665caa5bf446f5ff48045f1a92922d7e92c558fff143515f3c7b5964b0fc58",
  "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."
}