{
  "id": "328",
  "ident": "NS.00328",
  "slug": "erdos-10",
  "title": "Erdős Problem 10",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Is there some $k$ such that every large integer is the sum of a prime and at most $k$\npowers of $2$?",
  "subjects": [
    "math.CO",
    "math.NT",
    "msc:05",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos10.erdos_10",
  "statement_lean": "theorem erdos_10 : ∃ k, ∀ᶠ n : ℕ in atTop, n ∈ sumPrimeAndTwoPows k",
  "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 10\n\n*References:*\n- [erdosproblems.com/10](https://www.erdosproblems.com/10)\n- [Cr71] Crocker, R., On the sum of a prime and of two powers of two. Pacific J. Math. 36 (1971),\n  103-107.\n- [Ga75] Gallagher, P. X., Primes and powers of 2. Acta Arith. 29 (1976), 353-370.\n- [GrSo98] Granville, A. and Soundararajan, K., A binary additive problem of Erdős and the\n  order of $2$ mod $p^2$. Ramanujan J. 2 (1998), 283-298.\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos10\n\n/--\nThe set of natural numbers that can be written as a sum\nof a prime and at most $k$ powers of $2$.\n-/\nabbrev sumPrimeAndTwoPows (k : ℕ) : Set ℕ :=\n  { p + (pows.map (2 ^ ·)).sum | (p : ℕ) (pows : Multiset ℕ) (_ : p.Prime)\n    (_ : pows.card ≤ k)}\n\n/-- A prime is the sum of a prime and no powers of $2$. -/\n@[category test, AMS 5 11]\ntheorem two_mem_sumPrimeAndTwoPows_zero : 2 ∈ sumPrimeAndTwoPows 0 :=\n  ⟨2, 0, Nat.prime_two, by simp, by simp⟩\n\n/-- $1$ is smaller than every prime, so it lies in no `sumPrimeAndTwoPows k`. -/\n@[category test, AMS 5 11]\ntheorem one_not_mem_sumPrimeAndTwoPows (k : ℕ) : 1 ∉ sumPrimeAndTwoPows k := by\n  rintro ⟨p, pows, hp, -, h⟩\n  have : 2 ≤ p := hp.two_le\n  omega\n\n/--\nIs there some $k$ such that every large integer is the sum of a prime and at most $k$\npowers of $2$?\n-/\n@[category research open, question, AMS 5 11]\ntheorem erdos_10 : ∃ k, ∀ᶠ n : ℕ in atTop, n ∈ sumPrimeAndTwoPows k := by\n  sorry\n\n/--\nGallagher [Ga75] has shown that for any $ϵ > 0$ there exists $k(ϵ)$\nsuch that the set of integers which are the sum of a prime and at most $k(ϵ)$\nmany powers of $2$ has lower density at least $1 - ϵ$.\n\nRef: Gallagher, P. X., _Primes and powers of 2_.\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_10.variants.gallagher (ε : ℝ)\n    (hε : 0 < ε) : ∃ k, 1 - ε ≤ (sumPrimeAndTwoPows k).lowerDensity := by\n  sorry\n\n/--\nGranville and Soundararajan [GrSo98] have conjectured that at most $3$\npowers of $2$ suffice for all odd integers, and hence at most $4$ powers of $2$\nsuffice for all even integers.\n\nRef: Granville, A. and Soundararajan, K., _A Binary Additive Problem of Erdős and the Order of $2$ mod $p^2$_\n-/\n@[category research open, AMS 5 11]\ntheorem erdos_10.variants.granville_soundararajan_odd :\n    {n : ℕ | Odd n ∧ 1 < n} ⊆ sumPrimeAndTwoPows 3 ∧\n      {n : ℕ | Even n ∧ n ≠ 0} ⊆ sumPrimeAndTwoPows 4 := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nBogdan Grechuk has observed that `1117175146` is not the sum of a prime\nand at most $3$ powers of $2$.\n-/\n@[category research solved, AMS 5 11, formal_proof using lean4 at\n  \"https://github.com/linrock/math-proofs/blob/bed1ae569eaac7109327f644fa149b902b562873/erdos-10/Solution.lean#L36\"]\ntheorem erdos_10.variants.grechuk_example :\n    1117175146 ∉ sumPrimeAndTwoPows 3 := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nThere are infinitely many even integers not the sum of a prime and $2$ powers of $2$\n-/\n@[category research solved, AMS 5 11, formal_proof using lean4 at \"https://github.com/anatoliiohorodnyk/lean-fc-proofs/blob/5da9642575b26c2c816a49bcb56b33fed5456619/Proofs/T_Erdos10_erdos_10_variants_two_pows.lean#L340\"]\ntheorem erdos_10.variants.two_pows :\n    Set.Infinite <| {n : ℕ | Even n} \\ sumPrimeAndTwoPows 2 := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nBogdan Grechuk has observed that $1117175146$ is not the sum of a prime and at most $3$\npowers of $2$, and pointed out that parity considerations, coupled with the fact that there\nare many integers not the sum of a prime and $2$ powers of $2$ suggest that there exist\ninfinitely many even integers which are not the sum of a prime and at most $3$ powers of $2$.\n\nThis follows from Crocker's construction [Cr71] of infinitely many odd $t \\equiv 15 \\pmod{16}$\nwhich are not the sum of a prime and $2$ powers of $2$: each such $t + 1$ is even and not the\nsum of a prime and at most $3$ powers of $2$.\n\nThe linked Lean formalisation is by Daryxx, see comment section.\n-/\n@[category research solved, AMS 5 11, formal_proof using lean4 at\n  \"https://gist.github.com/DaryxXx/e112c74cc648b08a420b0959315cf65f/4b347897ff1811f1db1d82594c581f54b8f31b7d#file-main-lean-L2287\"]\ntheorem erdos_10.variants.grechuk :\n    Set.Infinite <| {n : ℕ | Even n} \\ sumPrimeAndTwoPows 3 := by\n  sorry\n\nend Erdos10\n",
  "statement_hash": "2773c5d6cad2239a161ec65db337984dad2a4356c0c5662dc904a58458ca5dc8",
  "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."
}