{
  "id": "781",
  "ident": "NS.00781",
  "slug": "erdos-1142",
  "title": "Erdős Problem 1142",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Are there infinitely many $n > 2$ such that $n - 2^k$ is prime for all $k \\geq 1$ with $2^k < n$?\n\nThe only known such $n$ are $4, 7, 15, 21, 45, 75, 105$ (OEIS [A039669](https://oeis.org/A039669)).",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1142.erdos_1142",
  "statement_lean": "theorem erdos_1142 :\n    Infinite { n | Erdos1142Prop n }",
  "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 1142\n\n*References:*\n- [erdosproblems.com/1142](https://www.erdosproblems.com/1142)\n- [A039669](https://oeis.org/A039669)\n- [Va99] Various, Some of Paul's favorite problems. Booklet produced for the conference \"Paul Erdős\n  and his mathematics\", Budapest, July 1999 (1999).\n- [MiWe69] Mientka, W. E. and Weitzenkamp, R. C., On f-plentiful numbers, Journal of\n  Combinatorial Theory, Volume 7, Issue 4, December 1969, pages 374-377.\n\n-/\n\n@[expose] public section\n\nopen Nat Set\n\nnamespace Erdos1142\n\n/--\nThe property that $n > 2$ and $n - 2^k$ is prime for all $k \\geq 1$ with $2^k < n$.\n\nFollowing the OEIS [A039669](https://oeis.org/A039669) convention (\"Numbers n > 2 such that ...\"),\nwe require $n > 2$ to exclude the trivial cases $n \\leq 2$, for which the primality condition\nis vacuously satisfied.\n-/\ndef Erdos1142Prop (n : ℕ) : Prop :=\n  2 < n ∧ ∀ k, 0 < k → 2 ^ k < n → (n - 2 ^ k).Prime\n\n/--\nAre there infinitely many $n > 2$ such that $n - 2^k$ is prime for all $k \\geq 1$ with $2^k < n$?\n\nThe only known such $n$ are $4, 7, 15, 21, 45, 75, 105$ (OEIS [A039669](https://oeis.org/A039669)).\n-/\n@[category research open, question, AMS 11]\ntheorem erdos_1142 :\n    Infinite { n | Erdos1142Prop n } := by\n  sorry\n\n/--\nMientka and Weitzenkamp [MiWe69] proved that the only $n \\leq 2^{44}$ such that $n > 2$ and\n$n - 2^k$ is prime for all $k \\geq 1$ with $2^k < n$ are $4, 7, 15, 21, 45, 75, 105$.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_1142.variants.mientka_weitzenkamp :\n    { n : ℕ | n ≤ 2 ^ 44 ∧ Erdos1142Prop n } = {4, 7, 15, 21, 45, 75, 105} := by\n  sorry\n/-- Helper tactic for proving `Erdos1142Prop` for small concrete values. -/\nlocal macro \"prove_erdos_1142_prop\" bound:num : tactic =>\n  `(tactic| (\n    refine ⟨by omega, fun k hk hlt => ?_⟩\n    have : k ≤ $bound := by\n      by_contra! h\n      exact absurd (Nat.pow_le_pow_right (by omega : 1 ≤ 2) h) (by omega)\n    interval_cases k <;> simp_all (config := { decide := true })))\n\n/-- $4$ satisfies the Erdős 1142 property: $4 - 2 = 2$ is prime. -/\n@[category test, AMS 11]\ntheorem erdos_1142.test_4 : Erdos1142Prop 4 := by prove_erdos_1142_prop 1\n\n/-- $7$ satisfies the Erdős 1142 property: $7 - 2 = 5$ and $7 - 4 = 3$ are prime. -/\n@[category test, AMS 11]\ntheorem erdos_1142.test_7 : Erdos1142Prop 7 := by prove_erdos_1142_prop 2\n\n/-- $15$ satisfies the Erdős 1142 property: $15 - 2 = 13$, $15 - 4 = 11$, $15 - 8 = 7$. -/\n@[category test, AMS 11]\ntheorem erdos_1142.test_15 : Erdos1142Prop 15 := by prove_erdos_1142_prop 3\n\n/-- $21$ satisfies the Erdős 1142 property: $21 - 2 = 19$, $21 - 4 = 17$, $21 - 8 = 13$,\n$21 - 16 = 5$. -/\n@[category test, AMS 11]\ntheorem erdos_1142.test_21 : Erdos1142Prop 21 := by prove_erdos_1142_prop 4\n\n/-- $45$ satisfies the Erdős 1142 property: $45 - 2 = 43$, $45 - 4 = 41$, $45 - 8 = 37$,\n$45 - 16 = 29$, $45 - 32 = 13$. -/\n@[category test, AMS 11]\ntheorem erdos_1142.test_45 : Erdos1142Prop 45 := by prove_erdos_1142_prop 5\n\n/-- $75$ satisfies the Erdős 1142 property: $75 - 2 = 73$, $75 - 4 = 71$, $75 - 8 = 67$,\n$75 - 16 = 59$, $75 - 32 = 43$, $75 - 64 = 11$. -/\n@[category test, AMS 11]\ntheorem erdos_1142.test_75 : Erdos1142Prop 75 := by prove_erdos_1142_prop 6\n\n/-- $105$ satisfies the Erdős 1142 property: the largest known example.\n$105 - 2 = 103$, $105 - 4 = 101$, $105 - 8 = 97$, $105 - 16 = 89$, $105 - 32 = 73$,\n$105 - 64 = 41$. -/\n@[category test, AMS 11]\ntheorem erdos_1142.test_105 : Erdos1142Prop 105 := by prove_erdos_1142_prop 6\n\n/-- $106$ does not satisfy the Erdős 1142 property ($106 - 2 = 104 = 8 \\times 13$). -/\n@[category test, AMS 11]\ntheorem erdos_1142.test_not_106 : ¬ Erdos1142Prop 106 := by\n  intro ⟨_, h⟩\n  have := h 1 (by omega) (by omega)\n  revert this; decide\n\nend Erdos1142\n",
  "statement_hash": "8a77312d58593c4037d14affce73f579318a4179e7362b67082b76868f325bc0",
  "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."
}