{
  "id": "1654",
  "ident": "NS.01654",
  "slug": "erdos-308",
  "title": "Erdős Problem 308",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $N\\geq 1$. What is the smallest integer not representable as the sum of distinct unit\nfractions with denominators from $\\{1,\\ldots,N\\}$?\n\nThis was essentially solved by Croot [Cr99] (see `erdos_308.variants.croot`); in particular,\nfor all sufficiently large $N$, the smallest such integer is either $m_N$ or $m_N+1$, where\n$m_N=\\lfloor \\sum_{n\\leq N}\\frac{1}{n}\\rfloor$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos308.erdos_308.parts.i",
  "statement_lean": "theorem erdos_308.parts.i : ∀ᶠ N : ℕ in atTop, f N = m N ∨ f N = m N + 1",
  "challenge_source": "/-\nCopyright 2025 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 308\n\n*References:*\n- [erdosproblems.com/308](https://www.erdosproblems.com/308)\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- [Cr99] Croot, III, Ernest S., _On some questions of Erdős and Graham about Egyptian\n  fractions_. Mathematika (1999), 359-372.\n-/\n\n@[expose] public section\n\nopen Filter Real\n\nnamespace Erdos308\n\n/-- `k` is representable as a sum of distinct unit fractions with denominators from\n`{1, …, N}`. -/\ndef IsRepresentable (N k : ℕ) : Prop :=\n  ∃ A ⊆ Finset.Icc 1 N, ∑ n ∈ A, (1 : ℚ) / n = k\n\n/-- The set of positive integers representable as a sum of distinct unit fractions with\ndenominators from `{1, …, N}`. -/\ndef representable (N : ℕ) : Set ℕ := {k | 0 < k ∧ IsRepresentable N k}\n\n/-- `f N` is the smallest positive integer which is not representable as a sum of distinct unit\nfractions with denominators from `{1, …, N}`. -/\nnoncomputable def f (N : ℕ) : ℕ := sInf {k | 0 < k ∧ ¬ IsRepresentable N k}\n\n/-- `m N = ⌊∑_{n ≤ N} 1/n⌋`. -/\ndef m (N : ℕ) : ℕ := ⌊harmonic N⌋₊\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $N\\geq 1$. What is the smallest integer not representable as the sum of distinct unit\nfractions with denominators from $\\{1,\\ldots,N\\}$?\n\nThis was essentially solved by Croot [Cr99] (see `erdos_308.variants.croot`); in particular,\nfor all sufficiently large $N$, the smallest such integer is either $m_N$ or $m_N+1$, where\n$m_N=\\lfloor \\sum_{n\\leq N}\\frac{1}{n}\\rfloor$.\n-/\n@[category research solved, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos308.lean#L458\"]\ntheorem erdos_308.parts.i : ∀ᶠ N : ℕ in atTop, f N = m N ∨ f N = m N + 1 := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $N\\geq 1$. Is it true that the set of integers representable as the sum of distinct unit\nfractions with denominators from $\\{1,\\ldots,N\\}$ has the shape $\\{1,\\ldots,m\\}$ for some $m$?\n\nIt follows from Croot's bounds [Cr99] that this holds for all sufficiently large $N$.\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/Erdos308.lean#L458\"]\ntheorem erdos_308.parts.ii :\n    ∀ᶠ N : ℕ in atTop, ∃ m, representable N = Set.Icc 1 m := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nIf $m_N=\\lfloor \\sum_{n\\leq N}\\frac{1}{n}\\rfloor$, then the set of integers representable is, for\nall $N$ sufficiently large, either $\\{1,\\ldots,m_N-1\\}$ or $\\{1,\\ldots,m_N\\}$.\n-/\n@[category research solved, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos308.lean#L458\"]\ntheorem erdos_308.variants.shape : ∀ᶠ N : ℕ in atTop,\n    representable N = Set.Icc 1 (m N - 1) ∨ representable N = Set.Icc 1 (m N) := by\n  sorry\n\n/--\nCroot [Cr99] bounded $\\eta(N)$, the largest integer such that every integer in\n$\\{1,\\ldots,\\eta(N)\\}$ is representable; this is $f(N)-1$, so his bounds read\n$$\\left\\lfloor\\sum_{n\\leq N}\\frac{1}{n}-\\frac{9}{2}(1+o(1))\\frac{(\\log\\log N)^2}{\\log N}\n\\right\\rfloor + 1 \\leq f(N)$$\nand\n$$f(N)\\leq \\left\\lfloor\\sum_{n\\leq N}\\frac{1}{n}-\\frac{1}{2}(1+o(1))\n\\frac{(\\log\\log N)^2}{\\log N}\\right\\rfloor + 1.$$\n-/\n@[category research solved, AMS 11]\ntheorem erdos_308.variants.croot :\n    ∃ o₁ o₂ : ℕ → ℝ, Tendsto o₁ atTop (nhds 0) ∧ Tendsto o₂ atTop (nhds 0) ∧\n      ∀ᶠ N : ℕ in atTop,\n        ⌊(harmonic N : ℝ) - 9 / 2 * (1 + o₁ N) * (log (log N)) ^ 2 / log N⌋₊ + 1 ≤ f N ∧\n        f N ≤ ⌊(harmonic N : ℝ) - 1 / 2 * (1 + o₂ N) * (log (log N)) ^ 2 / log N⌋₊ + 1 := by\n  sorry\n\n/--\nIs it true that, for every $N\\geq 1$, the set of integers representable as the sum of distinct\nunit fractions with denominators from $\\{1,\\ldots,N\\}$ has the shape $\\{1,\\ldots,m\\}$ for some\n$m$?\n-/\n@[category research open, question, AMS 11]\ntheorem erdos_308.variants.all_N :\n    ∀ N ≥ 1, ∃ m, representable N = Set.Icc 1 m := by\n  sorry\n\nend Erdos308\n",
  "statement_hash": "255724f09fc0c55864ee9b9d66813fc2aaed27cb68d51d1bb5443f14ea9de72c",
  "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."
}