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>0k > 0 such that (k+1)(k+2)⋯(k+n)+1(k+1)(k+2)\cdots(k+n) + 1 is prime · a_5

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 5.

Subjects:Number Theory (math.NT)
MSC classes:11
Cite as:NS.06857 [math.NT] · NS.06857v1 for this version
Declaration:OeisA78729.a_5
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 1; accepted critique: up to 100
Statement hash:070a7fe500083893450ca0924714f388b5c4066d3a191ef1a17aa8d84104c1de
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/OEIS/78729.lean

Formal statement

theorem a_5 : a 5 = 2
Show the full Challenge.lean (105 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Least $k > 0$ such that $(k+1)(k+2)\cdots(k+n) + 1$ is prime

The sequence $a(n)$ is the least positive integer $k$ such that $(k+1)(k+2)\cdots(k+n) + 1$ is
prime,
if such $k$ exists; otherwise $a(n) = 0$.

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

@[expose] public section

namespace OeisA78729

open Classical in
/-- Least positive integer $k$ such that $(k+1)(k+2)\cdots(k+n) + 1$ is prime, or 0 if no such $k$ exists. -/
noncomputable def a (n : ℕ) : ℕ :=
  if h : ∃ k, 0 < k ∧ (∏ i ∈ Finset.range n, (k + i + 1) + 1).Prime then
    Nat.find h
  else
    0

set_option backward.isDefEq.respectTransparency false in
/-- Value of the sequence `a` at 1. -/
@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by
  classical
  -- `dsimp` normalises `Finset.range 1` inside the condition but not in the `Decidable`
  -- instance, which stops `split_ifs` from firing.
  dsimp [a]
  split_ifs with h
  · rw [Nat.find_eq_iff]
    decide +native
  · exact (h ⟨1, by decide +native⟩).elim

/-- Value of the sequence `a` at 2. -/
@[category test, AMS 11]
theorem a_2 : a 2 = 1 := by
  classical
  dsimp [a]
  split_ifs with h
  · rw [Nat.find_eq_iff]
    decide +native
  · exact (h ⟨1, by decide +native⟩).elim

/-- Value of the sequence `a` at 3. -/
@[category test, AMS 11]
theorem a_3 : a 3 = 2 := by
  classical
  dsimp [a]
  split_ifs with h
  · rw [Nat.find_eq_iff]
    decide +native
  · exact (h ⟨2, by decide +native⟩).elim

/-- Value of the sequence `a` at 5. -/
@[category test, AMS 11]
theorem a_5 : a 5 = 2 := by
  classical
  dsimp [a]
  split_ifs with h
  · rw [Nat.find_eq_iff]
    decide +native
  · exact (h ⟨2, by decide +native⟩).elim

/-- Value of the sequence `a` at 6. -/
@[category test, AMS 11]
theorem a_6 : a 6 = 2 := by
  classical
  dsimp [a]
  split_ifs with h
  · rw [Nat.find_eq_iff]
    decide +native
  · exact (h ⟨2, by decide +native⟩).elim

/--
$(k+1)(k+2)(k+3)(k+4) + 1 = (k^2 + 5k + 5)^2$, which is never prime. Hence $a(4) = 0$.
Conjecture: $a(n) = 0$ if and only if $n = 4$.
-/
@[category research open, AMS 11]
theorem conjecture (n : ℕ) (hn : 0 < n) : a n = 0 ↔ n = 4 := by
  sorry

end OeisA78729

To prove it: keep every definition of Challenge.lean unchanged and prove OeisA78729.a_5 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_a_5 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

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