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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Triangular matchstick numbers in the class of prime numbers

Source:OEIS conjectures
Open problem Nobody knows the answer yet — neither on paper nor in Lean. First verified proof: +100 points.
Statement:reviewed
Statement:

Terms are squares at only(?) three values of n=3,6,4072n = 3, 6, 4072: corresponding terms are 6^2, 13^2, and 15735^2.

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

Formal statement

theorem conjecture :
    ∀ n : ℕ, 0 < n → (IsSquare (a n) ↔ (n = 3 ∨ n = 6 ∨ n = 4072))
Show the full Challenge.lean (113 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Triangular matchstick numbers in the class of prime numbers

$a(n) = \sum_{k = n}^{2n} p_k$, where $p_k$ is the $k$-th prime.

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

@[expose] public section

namespace OeisA105720

open Nat Finset

/--
The primary defining sequence `a`.
$a(n)$ is the sum of primes from the $n$-th prime to the $2n$-th prime, with $p_1=2$.
For $n=0$, we define $a(0) = 0$.
-/
noncomputable def a (n : ℕ) : ℕ :=
  if n = 0 then 0
  else ∑ i ∈ Ico (n - 1) (2 * n), Nat.nth Nat.Prime i

@[category API, AMS 11]
lemma nth_prime_five : Nat.nth Nat.Prime 5 = 13 := by
  have h1 : Nat.count Nat.Prime 13 = 5 := by decide
  have h2 : (13).Prime := by decide
  have h3 := Nat.nth_count h2
  rwa [h1] at h3

@[category API, AMS 11]
lemma nth_prime_six : Nat.nth Nat.Prime 6 = 17 := by
  have h1 : Nat.count Nat.Prime 17 = 6 := by decide
  have h2 : (17).Prime := by decide
  have h3 := Nat.nth_count h2
  rwa [h1] at h3

@[category API, AMS 11]
lemma nth_prime_seven : Nat.nth Nat.Prime 7 = 19 := by
  have h1 : Nat.count Nat.Prime 19 = 7 := by decide
  have h2 : (19).Prime := by decide
  have h3 := Nat.nth_count h2
  rwa [h1] at h3

macro "eval_a" : tactic => `(tactic| (
  repeat rw [Finset.sum_Ico_succ_top (by decide)]
  simp only [Finset.Ico_self, Finset.sum_empty, zero_add, add_zero]
  simp only [Nat.nth_prime_zero_eq_two, Nat.nth_prime_one_eq_three,
    Nat.nth_prime_two_eq_five, Nat.nth_prime_three_eq_seven,
    Nat.nth_prime_four_eq_eleven, nth_prime_five, nth_prime_six, nth_prime_seven]
  try rfl
))

/-- Value of the sequence `a` at 0. -/
@[category test, AMS 11]
theorem a_0 : a 0 = 0 := by
  rw [a, if_pos rfl]

/-- Value of the sequence `a` at 1. -/
@[category test, AMS 11]
theorem a_1 : a 1 = 5 := by
  rw [a, if_neg (by decide)]
  eval_a

/-- Value of the sequence `a` at 2. -/
@[category test, AMS 11]
theorem a_2 : a 2 = 15 := by
  rw [a, if_neg (by decide)]
  eval_a

/-- Value of the sequence `a` at 3. -/
@[category test, AMS 11]
theorem a_3 : a 3 = 36 := by
  rw [a, if_neg (by decide)]
  eval_a

/-- Value of the sequence `a` at 4. -/
@[category test, AMS 11]
theorem a_4 : a 4 = 67 := by
  rw [a, if_neg (by decide)]
  eval_a

/--
Terms are squares at only(?) three values of $n = 3, 6, 4072$:
corresponding terms are 6^2, 13^2, and 15735^2.
-/
@[category research open, AMS 11]
theorem conjecture :
    ∀ n : ℕ, 0 < n → (IsSquare (a n) ↔ (n = 3 ∨ n = 6 ∨ n = 4072)) := by
  sorry

end OeisA105720

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