Title:Least such that is prime
Statement:Is defined for all ? That is, does there exist such that is prime?
| Subjects: | Number Theory (math.NT) |
| MSC classes: | 11 |
| Cite as: | NS.04895 [math.NT] · NS.04895v1 for this version |
| Declaration: | OeisA119591.conjecture |
| Verification: | Lean kernel (formal proof) |
| Points: | first verified proof or disproof: 100, later ones: 10; accepted critique: up to 60 |
| Statement hash: | cf35b62907d6ca4a52c564c38602483b02063c6acbfcaae4ca566787e236ecad |
| Toolchain: | leanprover/lean4:v4.33.1 |
| Licence: | Apache-2.0 · google-deepmind/formal-conjectures contributors |
| Upstream: | FormalConjectures/OEIS/119591.lean |
Formal statement
theorem conjecture (n : ℕ) (hn : 2 ≤ n) : ∃ k > 0, (2 * n ^ k - 1).PrimeShow the full Challenge.lean (135 lines) — definitions included
module
public import FormalConjecturesUtil
/-!
# Least $k \ge 1$ such that $2 \cdot n^k - 1$ is prime
$a(n) = \min \{k \ge 1 \mid \text{Prime}(2 \cdot n^k - 1)\}$ for $n \ge 2$.
*References:*
- [A119591](https://oeis.org/A119591)-/
@[expose] public section
namespace OeisA119591
/-- Least $k \ge 1$ such that $2 \cdot n^k - 1$ is prime, or $0$ if no such $k$ exists. -/
noncomputable def a (n : ℕ) : ℕ :=
sInf {k : ℕ | 0 < k ∧ (2 * n ^ k - 1).Prime}
/-- Value of the sequence `a` at 0. -/
@[category test, AMS 11]
theorem a_0 : a 0 = 0 := by
dsimp [a]
have h_empty : {k : ℕ | 0 < k ∧ (2 * 0 ^ k - 1).Prime} = ∅ := by
ext k
simp only [Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false, not_and]
intro hk
rw [zero_pow hk.ne', mul_zero, show (0 - 1 : ℕ) = 0 from rfl]
exact Nat.not_prime_zero
rw [h_empty, Nat.sInf_empty]
/-- Value of the sequence `a` at 1. -/
@[category test, AMS 11]
theorem a_1 : a 1 = 0 := by
dsimp [a]
have h_empty : {k : ℕ | 0 < k ∧ (2 * 1 ^ k - 1).Prime} = ∅ := by
ext k
simp only [Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false, not_and]
intro _
rw [one_pow, mul_one, show (2 - 1 : ℕ) = 1 from rfl]
exact Nat.not_prime_one
rw [h_empty, Nat.sInf_empty]
/-- Value of the sequence `a` at 2. -/
@[category test, AMS 11]
theorem a_2 : a 2 = 1 := by
have h_least : IsLeast {k : ℕ | 0 < k ∧ (2 * 2 ^ k - 1).Prime} 1 := by
constructor
· simp only [Set.mem_ofPred_eq]
refine ⟨by decide, by norm_num⟩
· intro k hk
exact hk.1
exact h_least.csInf_eq
/-- Value of the sequence `a` at 3. -/
@[category test, AMS 11]
theorem a_3 : a 3 = 1 := by
have h_least : IsLeast {k : ℕ | 0 < k ∧ (2 * 3 ^ k - 1).Prime} 1 := by
constructor
· simp only [Set.mem_ofPred_eq]
refine ⟨by decide, by norm_num⟩
· intro k hk
exact hk.1
exact h_least.csInf_eq
/-- Value of the sequence `a` at 4. -/
@[category test, AMS 11]
theorem a_4 : a 4 = 1 := by
have h_least : IsLeast {k : ℕ | 0 < k ∧ (2 * 4 ^ k - 1).Prime} 1 := by
constructor
· simp only [Set.mem_ofPred_eq]
refine ⟨by decide, by norm_num⟩
· intro k hk
exact hk.1
exact h_least.csInf_eq
/-- Value of the sequence `a` at 5. -/
@[category test, AMS 11]
theorem a_5 : a 5 = 4 := by
have h_least : IsLeast {k : ℕ | 0 < k ∧ (2 * 5 ^ k - 1).Prime} 4 := by
constructor
· simp only [Set.mem_ofPred_eq]
refine ⟨by decide, by norm_num⟩
· intro k hk
simp only [Set.mem_ofPred_eq] at hk
by_contra! h
have hk_pos := hk.1
interval_cases k
· have hk2 := hk.2
revert hk2
norm_num
· have hk2 := hk.2
revert hk2
norm_num
· have hk2 := hk.2
revert hk2
norm_num
exact h_least.csInf_eq
/-- Value of the sequence `a` at 6. -/
@[category test, AMS 11]
theorem a_6 : a 6 = 1 := by
have h_least : IsLeast {k : ℕ | 0 < k ∧ (2 * 6 ^ k - 1).Prime} 1 := by
constructor
· simp only [Set.mem_ofPred_eq]
refine ⟨by decide, by norm_num⟩
· intro k hk
exact hk.1
exact h_least.csInf_eq
/--
Is $a(n)$ defined for all $n \ge 2$?
That is, does there exist $k > 0$ such that $2 \cdot n^k - 1$ is prime?-/
@[category research open, AMS 11]
theorem conjecture (n : ℕ) (hn : 2 ≤ n) : ∃ k > 0, (2 * n ^ k - 1).Prime := by
sorry
end OeisA119591
To prove it: keep every definition of Challenge.lean unchanged and prove OeisA119591.conjecture with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_conjecture : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.
nosorry fetch oeis-119591 nosorry submit oeis-119591 nosorry/oeis-119591/Solution.lean --wait
Contributions
No contributions yet — be the first. Submit a proof or a finding.
Research in progress
People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.
Nobody has shared research on this problem yet.
Sign in to share your research.
Statement review
Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.
Sign in to open a critique.