{
  "id": "6271",
  "ident": "NS.06271",
  "slug": "oeis-34693",
  "title": "Smallest number $k$ such that $kn + 1$ is prime",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Conjecture: for every $n > 1$ there exists a number $k < n$ such that $nk + 1$ is a prime.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA34693.exists_k",
  "statement_lean": "theorem exists_k {n : ℕ} (hn : 1 < n) : ∃ k < n, (n * k + 1).Prime",
  "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# Smallest number $k$ such that $kn + 1$ is prime\n\n*References:*\n- [A34693](https://oeis.org/A34693)\n-/\n\n@[expose] public section\n\nnamespace OeisA34693\n\nopen Filter\n\n/-- Smallest number $k$ such that $kn + 1$ is prime. -/\nnoncomputable def a (n : ℕ) : ℕ := Nat.nth (fun k ↦ (k * n + 1).Prime) 0\n\n@[category test, AMS 11]\ntheorem a_0 : a 0 = 0 := by simp [a]\n\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 1 := by\n  conv_rhs => rw [← Nat.nth_count (p := fun k ↦ (k + 1).Prime) (n := 1) (by norm_num)]\n  aesop (add simp [a])\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 1 := by\n  conv_rhs => rw [← Nat.nth_count (p := fun k ↦ (k * 2 + 1).Prime) (n := 1) (by norm_num)]\n  aesop (add simp [a])\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 2 := by\n  conv_rhs => rw [← Nat.nth_count (p := fun k ↦ (k * 3 + 1).Prime) (n := 2) (by norm_num)]\n  aesop (add simp [a])\n\n@[category test, AMS 11]\ntheorem a_7 : a 7 = 4 := by\n  conv_rhs => rw [← Nat.nth_count (p := fun k ↦ (k * 7 + 1).Prime) (n := 4) (by norm_num)]\n  aesop (add simp [a])\n\n/-- Conjecture: for every $n > 1$ there exists a number $k < n$ such that $nk + 1$ is a prime. -/\n@[category research open, AMS 11]\ntheorem exists_k {n : ℕ} (hn : 1 < n) : ∃ k < n, (n * k + 1).Prime := by\n  sorry\n\n/-- A stronger conjecture: for every n there exists a number $k < 1 + n^{0.75}$ such that\n$nk + 1$ is a prime. -/\n@[category research open, AMS 11]\ntheorem exists_k_stronger {n : ℕ} (hn : 0 < n) : ∃ k : ℕ,\n    k < 1 + (Real.nthRoot 4 n) ^ 3 ∧ (n * k + 1).Prime := by\n  sorry\n\n/-- The expression $1 + n^{0.74}$ does not work as an upper bound. -/\n@[category research solved, AMS 11]\ntheorem exists_k_best_possible : ∃ n > (0 : ℕ), ∀ (k : ℕ),\n    k < 1 + (Real.nthRoot 100 n) ^ 74 → ¬(n * k + 1).Prime := by\n  refine ⟨19, by norm_num, ?_⟩\n  have hy : Real.nthRoot 100 ((19 : ℕ) : ℝ) = (19 : ℝ) ^ (((100 : ℕ) : ℝ))⁻¹ := by\n    simp only [Real.nthRoot]\n    rw [if_pos (by decide : Even 100)]\n    norm_num\n  have h100 : (Real.nthRoot 100 ((19 : ℕ) : ℝ)) ^ (100 : ℕ) = 19 := by\n    rw [hy]; exact Real.rpow_inv_natCast_pow (by norm_num) (by norm_num)\n  have hb : (Real.nthRoot 100 ((19 : ℕ) : ℝ)) ^ 74 ≤ 9 := by\n    apply le_of_pow_le_pow_left₀ (n := 100) (by norm_num) (by norm_num)\n    have e : ((Real.nthRoot 100 ((19 : ℕ) : ℝ)) ^ (74 : ℕ)) ^ (100 : ℕ)\n        = ((Real.nthRoot 100 ((19 : ℕ) : ℝ)) ^ (100 : ℕ)) ^ (74 : ℕ) := by\n      rw [← pow_mul, ← pow_mul, Nat.mul_comm]\n    rw [e, h100]\n    norm_num\n  intro k hk\n  have hk10 : (k : ℝ) < 10 := by linarith\n  have hk10' : k < 10 := by exact_mod_cast hk10\n  interval_cases k <;> norm_num\n\n/-- Conjecture: $a(n) = O(\\log(n)\\log(\\log(n)))$. -/\n@[category research open, AMS 11]\ntheorem a_isBigO : (fun n ↦ (a n : ℝ)) =O[atTop] (fun n ↦ Real.log n * Real.log (Real.log n)) := by\n  sorry\n\n/-- Counter-conjecture to `a_isBigO`: $a(n) / (\\log n \\log \\log n)$ is unbounded. -/\n@[category research open, AMS 11]\ntheorem a_unbounded : ¬BddAbove (Set.range fun n ↦ a n / (Real.log n * Real.log (Real.log n))) := by\n  sorry\n\nend OeisA34693\n",
  "statement_hash": "8d4952e754da765e3d7ce88b888967a3ff2986cd4f022bc3cad5c15065d17f01",
  "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."
}