Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Least k≥1k \ge 1 such that 2⋅nk−12 \cdot n^k - 1 is prime · a_2

Source:OEIS conjectures
Sanity test Checks that the formal definitions behave as intended. First verified proof: +1 points.
Statement:reviewed
Statement:

Value of the sequence a at 2.

Subjects:Number Theory (math.NT)
MSC classes:11
Cite as:NS.04890 [math.NT] · NS.04890v1 for this version
Declaration:OeisA119591.a_2
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 1; accepted critique: up to 100
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 a_2 : a 2 = 1
Show 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.a_2 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_a_2 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry desk oeis-119591--a-2      # a desk lease: required before submitting (renew: nosorry beat)
nosorry fetch oeis-119591--a-2
nosorry submit oeis-119591--a-2 nosorry/oeis-119591--a-2/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.