{
  "id": "5886",
  "ident": "NS.05886",
  "slug": "oeis-247824",
  "title": "Least $m$ such that $m + n$ divides $\\mathrm{prime}(m) + \\mathrm{prime}(n)$",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Conjecture: $a(n)$ exists for any $n > 0$.\nThe existence of $a(n)$ for $n > 0$ is formalized by requiring that the defining set is nonempty\n(equivalently, $0 < a(n)$).\n- _Zhi-Wei Sun_, Sep 25 2014",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA247824.conjecture_1",
  "statement_lean": "theorem conjecture_1 (n : ℕ) (hn : 0 < n) :\n    ({ m : ℕ | 0 < m ∧\n      (m + n) ∣ (Nat.nth Nat.Prime (m - 1) + Nat.nth Nat.Prime (n - 1)) }).Nonempty",
  "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# Least $m$ such that $m + n$ divides $\\mathrm{prime}(m) + \\mathrm{prime}(n)$\n\nThe sequence $a(n)$ is the least positive integer $m$ such that $m + n$ divides\n$\\mathrm{prime}(m) + \\mathrm{prime}(n)$, where $\\mathrm{prime}(k)$ denotes the $k$-th prime number\n(with $\\mathrm{prime}(1) = 2$).\n\n*References:*\n- [A247824](https://oeis.org/A247824)\n-/\n\n@[expose] public section\n\nnamespace OeisA247824\n\nopen Nat Set\n\n/-- Least positive integer $m$ such that $m + n$ divides $\\mathrm{prime}(m) + \\mathrm{prime}(n)$.\nIf no such $m$ exists (or if $n = 0$), returns $0$. -/\nnoncomputable def a (n : ℕ) : ℕ :=\n  if n = 0 then 0 else\n  sInf { m : ℕ | 0 < m ∧ (m + n) ∣ (Nat.nth Nat.Prime (m - 1) + Nat.nth Nat.Prime (n - 1)) }\n\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 1 := by\n  dsimp [a]\n  apply IsLeast.csInf_eq\n  refine ⟨⟨by omega, ?_⟩, fun m hm => hm.1⟩\n  have h : Nat.nth Nat.Prime 0 + Nat.nth Nat.Prime 0 = 2 * Nat.nth Nat.Prime 0 := by ring\n  rw [h]\n  exact dvd_mul_right 2 _\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 5 := by\n  dsimp [a]\n  apply IsLeast.csInf_eq\n  refine ⟨⟨by omega, ?_⟩, fun m hm => ?_⟩\n  · norm_num [Nat.nth_prime_four_eq_eleven, Nat.nth_prime_one_eq_three]\n  · by_contra! hlt\n    have hm1 := hm.1\n    interval_cases m\n    · revert hm; norm_num [Nat.nth_prime_zero_eq_two, Nat.nth_prime_one_eq_three]\n    · revert hm; norm_num [Nat.nth_prime_one_eq_three]\n    · revert hm; norm_num [Nat.nth_prime_two_eq_five, Nat.nth_prime_one_eq_three]\n    · revert hm; norm_num [Nat.nth_prime_three_eq_seven, Nat.nth_prime_one_eq_three]\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 5 := by\n  dsimp [a]\n  apply IsLeast.csInf_eq\n  refine ⟨⟨by omega, ?_⟩, fun m hm => ?_⟩\n  · norm_num [Nat.nth_prime_four_eq_eleven, Nat.nth_prime_two_eq_five]\n  · by_contra! hlt\n    have hm1 := hm.1\n    interval_cases m\n    · revert hm; norm_num [Nat.nth_prime_zero_eq_two, Nat.nth_prime_two_eq_five]\n    · revert hm; norm_num [Nat.nth_prime_one_eq_three, Nat.nth_prime_two_eq_five]\n    · revert hm; norm_num [Nat.nth_prime_two_eq_five]\n    · revert hm; norm_num [Nat.nth_prime_three_eq_seven, Nat.nth_prime_two_eq_five]\n\n@[category test, AMS 11]\ntheorem a_4 : a 4 = 5 := by\n  dsimp [a]\n  apply IsLeast.csInf_eq\n  refine ⟨⟨by omega, ?_⟩, fun m hm => ?_⟩\n  · norm_num [Nat.nth_prime_four_eq_eleven, Nat.nth_prime_three_eq_seven]\n  · by_contra! hlt\n    have hm1 := hm.1\n    interval_cases m\n    · revert hm; norm_num [Nat.nth_prime_zero_eq_two, Nat.nth_prime_three_eq_seven]\n    · revert hm; norm_num [Nat.nth_prime_one_eq_three, Nat.nth_prime_three_eq_seven]\n    · revert hm; norm_num [Nat.nth_prime_two_eq_five, Nat.nth_prime_three_eq_seven]\n    · revert hm; norm_num [Nat.nth_prime_three_eq_seven]\n\n@[category test, AMS 11]\ntheorem a_5 : a 5 = 2 := by\n  dsimp [a]\n  apply IsLeast.csInf_eq\n  refine ⟨⟨by omega, ?_⟩, fun m hm => ?_⟩\n  · norm_num [Nat.nth_prime_one_eq_three, Nat.nth_prime_four_eq_eleven]\n  · by_contra! hlt\n    have hm1 := hm.1\n    interval_cases m\n    · revert hm; norm_num [Nat.nth_prime_zero_eq_two, Nat.nth_prime_four_eq_eleven]\n\n/--\nConjecture: $a(n)$ exists for any $n > 0$.\nThe existence of $a(n)$ for $n > 0$ is formalized by requiring that the defining set is nonempty\n(equivalently, $0 < a(n)$).\n- _Zhi-Wei Sun_, Sep 25 2014\n-/\n@[category research open, AMS 11]\ntheorem conjecture_1 (n : ℕ) (hn : 0 < n) :\n    ({ m : ℕ | 0 < m ∧\n      (m + n) ∣ (Nat.nth Nat.Prime (m - 1) + Nat.nth Nat.Prime (n - 1)) }).Nonempty := by\n  sorry\n\n/--\nConjecture: $a(n) < n(n-1)$ for all $n > 2$.\n- _Zhi-Wei Sun_, Sep 25 2014\n\nDisproved by Khai-Hoan Nguyen-Dang (Oct 30 2026), who found the counterexample\n$n = 1322164$, for which $a(1322164) = 2636932401176 > 1748116320732 = 1322164 \\cdot 1322163$.\n-/\n@[category research solved, AMS 11]\ntheorem conjecture_2 : ¬ ∀ n : ℕ, 2 < n → a n < n * (n - 1) := by\n  sorry\n\nend OeisA247824\n",
  "statement_hash": "2eba5991d66517fa2b4ea30dd4400c81133196a551222d99fcedfcb10b3771a0",
  "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."
}