{
  "id": "4980",
  "ident": "NS.04980",
  "slug": "oeis-159829",
  "title": "Smallest $m$ such that $n^3 + m^3 + 1$ is prime",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Conjecture 1: For any $k \\ge 3$, there are infinitely many primes of the form $n^k + m^k$\nfor $n, m \\ge 1$.\n- _Ulrich Krug_, 2009\n\nAnswer: No.\n- _Kenta Kitamura_, 2026",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA159829.conjecture1",
  "statement_lean": "theorem conjecture1 :\n    ¬ ∀ (k : ℕ), 3 ≤ k →\n      Set.Infinite {p : ℕ | ∃ n m : ℕ, 1 ≤ n ∧ 1 ≤ m ∧ p.Prime ∧\n        p = n ^ k + m ^ k}",
  "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# Smallest $m$ such that $n^3 + m^3 + 1$ is prime\n\n$a(n)$ is the smallest natural number $m \\ge 1$ such that $n^3 + m^3 + 1$ is prime.\n\n*References:*\n- [A159829](https://oeis.org/A159829)-/\n\n@[expose] public section\n\nnamespace OeisA159829\n\nopen Classical in\n/-- $a(n)$ is the smallest natural number $m \\ge 1$ such that $n^3 + m^3 + 1$ is prime,\nor `none` if no such $m$ exists. -/\nnoncomputable def a (n : ℕ) : Option ℕ :=\n  if ∃ m : ℕ, 1 ≤ m ∧ (n ^ 3 + m ^ 3 + 1).Prime then\n    some (sInf {m : ℕ | 1 ≤ m ∧ (n ^ 3 + m ^ 3 + 1).Prime})\n  else\n    none\n\n/-- Value of the sequence `a` at 1. -/\n@[category test, AMS 11]\ntheorem a_1 : a 1 = some 1 := by\n  have h : IsLeast {m : ℕ | 1 ≤ m ∧ (1 ^ 3 + m ^ 3 + 1).Prime} 1 :=\n    ⟨⟨le_rfl, by decide⟩, fun m hm => hm.1⟩\n  have h_ex : ∃ m : ℕ, 1 ≤ m ∧ (1 ^ 3 + m ^ 3 + 1).Prime := ⟨1, h.1⟩\n  rw [a, if_pos h_ex, h.csInf_eq]\n\n/-- Value of the sequence `a` at 2. -/\n@[category test, AMS 11]\ntheorem a_2 : a 2 = some 2 := by\n  have h : IsLeast {m : ℕ | 1 ≤ m ∧ (2 ^ 3 + m ^ 3 + 1).Prime} 2 :=\n    ⟨⟨by decide, by decide⟩, fun m hm => by\n      by_contra hc\n      have hm1 : 1 ≤ m := hm.1\n      have hm2 : m < 2 := not_le.mp hc\n      obtain ⟨_, hprime⟩ := hm\n      interval_cases m\n      revert hprime\n      decide⟩\n  have h_ex : ∃ m : ℕ, 1 ≤ m ∧ (2 ^ 3 + m ^ 3 + 1).Prime := ⟨2, h.1⟩\n  rw [a, if_pos h_ex, h.csInf_eq]\n\n/-- Value of the sequence `a` at 3. -/\n@[category test, AMS 11]\ntheorem a_3 : a 3 = some 1 := by\n  have h : IsLeast {m : ℕ | 1 ≤ m ∧ (3 ^ 3 + m ^ 3 + 1).Prime} 1 :=\n    ⟨⟨le_rfl, by decide⟩, fun m hm => hm.1⟩\n  have h_ex : ∃ m : ℕ, 1 ≤ m ∧ (3 ^ 3 + m ^ 3 + 1).Prime := ⟨1, h.1⟩\n  rw [a, if_pos h_ex, h.csInf_eq]\n\n/-- Value of the sequence `a` at 4. -/\n@[category test, AMS 11]\ntheorem a_4 : a 4 = some 2 := by\n  have h : IsLeast {m : ℕ | 1 ≤ m ∧ (4 ^ 3 + m ^ 3 + 1).Prime} 2 :=\n    ⟨⟨by decide, by decide⟩, fun m hm => by\n      by_contra hc\n      have hm1 : 1 ≤ m := hm.1\n      have hm2 : m < 2 := not_le.mp hc\n      obtain ⟨_, hprime⟩ := hm\n      interval_cases m\n      revert hprime\n      decide⟩\n  have h_ex : ∃ m : ℕ, 1 ≤ m ∧ (4 ^ 3 + m ^ 3 + 1).Prime := ⟨2, h.1⟩\n  rw [a, if_pos h_ex, h.csInf_eq]\n\nset_option linter.style.formal_proof_palomar false in\n/--\nConjecture 1: For any $k \\ge 3$, there are infinitely many primes of the form $n^k + m^k$\nfor $n, m \\ge 1$.\n- _Ulrich Krug_, 2009\n\nAnswer: No.\n- _Kenta Kitamura_, 2026\n-/\n@[category research solved, question, AMS 11,\n  formal_proof using lean4 at\n    \"https://github.com/KitaKen1/oeis-a159829-conjecture1-counterexample/blob/6632e626baa7f28ad14045aa7408a84178ec128d/lean/A159829Conjecture1FC.lean#L52-L61\"]\ntheorem conjecture1 :\n    ¬ ∀ (k : ℕ), 3 ≤ k →\n      Set.Infinite {p : ℕ | ∃ n m : ℕ, 1 ≤ n ∧ 1 ≤ m ∧ p.Prime ∧\n        p = n ^ k + m ^ k} := by\n  sorry\n\n/--\nConjecture 2: For any $k \\ge 3$, there are infinitely many primes of the form $n^k + m^k + 1$\nfor $n, m \\ge 1$.\n- _Ulrich Krug_, 2009\n-/\n@[category research open, AMS 11]\ntheorem conjecture2 (k : ℕ) (hk : 3 ≤ k) :\n    Set.Infinite {p : ℕ | ∃ n m : ℕ, 1 ≤ n ∧ 1 ≤ m ∧ p.Prime ∧ p = n ^ k + m ^ k + 1} := by\n  sorry\n\nend OeisA159829\n",
  "statement_hash": "28d8d3a1c5f1cf761b35f93ef0fca8836e55561a84d4aa1f3cc3cf8c7feba6ab",
  "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."
}