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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Smallest prime pp such that p+np + n is an nn-th power

Source:OEIS conjectures
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Conjecture: if a(k) = 0 then k is an even square.

This is false for k=27k = 27. Every candidate x27−27x^{27} - 27 factors as (x9−3)(x18+3x9+9)(x^9 - 3)(x^{18} + 3x^9 + 9), so a(27)=0a(27) = 0, but 2727 is not an even square.

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:formal_proof
Cite as:NS.06907 [math.NT] · NS.06907v1 for this version
Declaration:OeisA84046.conjecture
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:da8977859ebe214e98ba9c5974259cb1a491756b3ea535b36f7847d65e9cf570
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/OEIS/84046.lean

Formal statement

theorem conjecture : ¬ ∀ k : ℕ, a k = 0 → ∃ m : ℕ, k = (2 * m) ^ 2
Show the full Challenge.lean (116 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Smallest prime $p$ such that $p + n$ is an $n$-th power

Smallest prime $p$ such that $p + n$ is an $n$-th power, or $0$ if no such number exists.
That is, the smallest prime of the form $k^n - n$.

*References:*
- [A084046](https://oeis.org/A084046)-/

@[expose] public section

namespace OeisA84046

/-- Smallest prime $p$ such that $p + n$ is an $n$-th power, or $0$ if no such prime exists. -/
noncomputable def a (n : ℕ) : ℕ :=
  sInf {p : ℕ | p.Prime ∧ ∃ k : ℕ, k ^ n = p + n}

/-- Value of the sequence `a` at 0. -/
@[category test, AMS 11]
theorem a_0 : a 0 = 0 := by
  change sInf {p : ℕ | p.Prime ∧ ∃ k : ℕ, k ^ 0 = p + 0} = 0
  have h_empty : {p : ℕ | p.Prime ∧ ∃ k : ℕ, k ^ 0 = p + 0} = ∅ := by
    ext p
    simp only [Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false, not_and]
    intro hp ⟨k, hk⟩
    rw [pow_zero, add_zero] at hk
    subst hk
    exact Nat.not_prime_one hp
  rw [h_empty, Nat.sInf_empty]

/-- Value of the sequence `a` at 1. -/
@[category test, AMS 11]
theorem a_1 : a 1 = 2 := by
  have h_least : IsLeast {p : ℕ | p.Prime ∧ ∃ k : ℕ, k ^ 1 = p + 1} 2 := by
    constructor
    · simp only [Set.mem_ofPred_eq]
      refine ⟨Nat.prime_two, 3, by norm_num⟩
    · intro p hp
      simp only [Set.mem_ofPred_eq] at hp
      exact hp.1.two_le
  exact h_least.csInf_eq

/-- Value of the sequence `a` at 2. -/
@[category test, AMS 11]
theorem a_2 : a 2 = 2 := by
  have h_least : IsLeast {p : ℕ | p.Prime ∧ ∃ k : ℕ, k ^ 2 = p + 2} 2 := by
    constructor
    · simp only [Set.mem_ofPred_eq]
      refine ⟨Nat.prime_two, 2, by norm_num⟩
    · intro p hp
      simp only [Set.mem_ofPred_eq] at hp
      exact hp.1.two_le
  exact h_least.csInf_eq

/-- Value of the sequence `a` at 3. -/
@[category test, AMS 11]
theorem a_3 : a 3 = 5 := by
  have h_least : IsLeast {p : ℕ | p.Prime ∧ ∃ k : ℕ, k ^ 3 = p + 3} 5 := by
    constructor
    · simp only [Set.mem_ofPred_eq]
      refine ⟨by norm_num, 2, by norm_num⟩
    · intro p hp
      simp only [Set.mem_ofPred_eq] at hp
      rcases hp with ⟨hp_prime, k, hk⟩
      by_contra! h
      interval_cases p
      · exact Nat.not_prime_zero hp_prime
      · exact Nat.not_prime_one hp_prime
      · rcases (show k ≤ 1 ∨ 2 ≤ k by omega) with hk_le | hk_ge
        · interval_cases k <;> revert hk <;> decide
        · have : 8 ≤ k ^ 3 := by
            calc 8 = 2 ^ 3 := by decide
            _ ≤ k ^ 3 := Nat.pow_le_pow_left hk_ge 3
          omega
      · rcases (show k ≤ 1 ∨ 2 ≤ k by omega) with hk_le | hk_ge
        · interval_cases k <;> revert hk <;> decide
        · have : 8 ≤ k ^ 3 := by
            calc 8 = 2 ^ 3 := by decide
            _ ≤ k ^ 3 := Nat.pow_le_pow_left hk_ge 3
          omega
      · exact (by decide : ¬ Nat.Prime 4) hp_prime
  exact h_least.csInf_eq

set_option linter.style.formal_proof_palomar false in
/--
Conjecture: if a(k) = 0 then k is an even square.

This is false for $k = 27$. Every candidate $x^{27} - 27$ factors as
$(x^9 - 3)(x^{18} + 3x^9 + 9)$, so $a(27) = 0$, but $27$ is not an even square.
-/
@[category research solved, AMS 11, formal_proof using lean4 at
  "https://github.com/epoch-research/LeanOpenProblems-results/blob/f02efd9a8c5fc6a735d2a90c33e24f7278ce0ffc/runs/oeis-full-50usd-oai-jajpvieznaevpoyg/a084046_conjecture_0/Submission/Spec.lean#L17"]
theorem conjecture : ¬ ∀ k : ℕ, a k = 0 → ∃ m : ℕ, k = (2 * m) ^ 2 := by
  sorry

end OeisA84046

To prove it: keep every definition of Challenge.lean unchanged and prove OeisA84046.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-84046
nosorry submit oeis-84046 nosorry/oeis-84046/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.