Title:A generalized Stern sequence
Statement:Conjecture: . This formalizes the equality .
| Subjects: | Number Theory (math.NT) |
| MSC classes: | 11 |
| Tags: | formal_proof |
| Cite as: | NS.04725 [math.NT] · NS.04725v1 for this version |
| Declaration: | OeisA112970.conjecture1 |
| Verification: | Lean kernel (formal proof) |
| Points: | first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60 |
| Statement hash: | 29a61b6f827e033e7db285f008b315aeaba0c9c16e0a6a8e367d69b70dcc634a |
| Toolchain: | leanprover/lean4:v4.33.1 |
| Licence: | Apache-2.0 · google-deepmind/formal-conjectures contributors |
| Upstream: | FormalConjectures/OEIS/112970.lean |
Formal statement
theorem conjecture1 (n : ℕ) : a (2^n) = a (2^(n + 1) + 1)Show the full Challenge.lean (110 lines) — definitions included
module
public import FormalConjecturesUtil
/-!
# A generalized Stern sequence
A112970: A generalized Stern sequence, defined by the recurrence relations:
$a(2n+1) = a(n)$ and $a(2n) = a(n) + a(n-2)$ with $a(0)=1$, $a(1)=1$ and $a(n)=0$ for $n \le -1$.
*References:*
- [A112970](https://oeis.org/A112970)
-/
@[expose] public section
namespace OeisA112970
/--
a n is the generalized Stern sequence, defined by the recurrence relations:
$a(2n+1) = a(n)$ and $a(2n) = a(n)$ + $a(n-2)$ with $a(0) = 1$, $a(1) = 1$
and $a(n) = 0$ for $n \le -1$.
-/
def a (n : ℕ) : ℕ :=
if n = 0 then 1
else if n = 1 then 1
else
let k := n / 2
if n % 2 = 1 then -- Odd case: a(2k + 1) = a(k)
a k
else -- Even case: a(2k) = a(k) + a(k - 2)
let aPrev : ℕ :=
-- a(m) is 0 if m < 0. Equivalent to checking k < 2 for the argument k-2.
if k < 2 then 0
else a (k - 2)
a k + aPrev
termination_by n
@[category test, AMS 11]
theorem a_0 : a 0 = 1 := by unfold a; rfl
@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by unfold a; rfl
@[category test, AMS 11]
theorem a_2 : a 2 = 1 := by unfold a; unfold a; unfold a; rfl
@[category test, AMS 11]
theorem a_3 : a 3 = 1 := by unfold a; unfold a; rfl
@[category test, AMS 11]
theorem a_4 : a 4 = 2 := by unfold a; unfold a; unfold a; unfold a; rfl
set_option linter.style.formal_proof_palomar false in
/--
Conjecture: $a(2^n)=a(2^(n+1)+1)=\textrm{A033638}(n)$.
This formalizes the equality $a(2^n) = a(2^(n+1)+1)$.
-/
@[category research solved, AMS 11,
formal_proof using lean4 at
"https://github.com/KitaKen1/oeis-a112970-formal-conjectures/blob/71ae72f443bd9bee7d958f0a19d9f9ec5ab82af5/lean/OeisA112970FC.lean#L43-L46"]
theorem conjecture1 (n : ℕ) : a (2^n) = a (2^(n + 1) + 1) := by
sorry
set_option linter.style.formal_proof_palomar false in
/--
Second part of the conjecture, $a(2^n)=\textrm{A033638}(n)=\lfloor n^2 / 4 \rfloor + 1$.
It holds by induction on $n$, since $a(2^{n+1}) = a(2^n) + a(2^n - 2)$ for $n \ge 1$ and
$a(2^m - 2) = \lfloor (m+1)/2 \rfloor$ for $m \ge 1$.
-/
@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/anatoliiohorodnyk/lean-fc-proofs/blob/5da9642575b26c2c816a49bcb56b33fed5456619/Proofs/T_OeisA112970_conjecture1_value.lean#L139"]
theorem conjecture1_value (n : ℕ) : a (2^n) = n ^ 2 / 4 + 1 := by
sorry
set_option linter.style.formal_proof_palomar false in
/--
Conjecture: $a(2^n-1)=a(3*2^n-1)=1$.
This formalizes the equality part $a(2^n-1) = a(3*2^n-1)$.
-/
@[category research solved, AMS 11,
formal_proof using lean4 at
"https://github.com/KitaKen1/oeis-a112970-formal-conjectures/blob/71ae72f443bd9bee7d958f0a19d9f9ec5ab82af5/lean/OeisA112970FC.lean#L56-L64"]
theorem conjecture2 (n : ℕ) : a (2^n - 1) = a (3 * 2^n - 1) := by
sorry
set_option linter.style.formal_proof_palomar false in
/-- Conjecture: $a(2^n-1)=a(3*2^n-1)=1$. This formalizes the value part $a(2^n-1)=1$. -/
@[category research solved, AMS 11,
formal_proof using lean4 at
"https://github.com/KitaKen1/oeis-a112970-formal-conjectures/blob/71ae72f443bd9bee7d958f0a19d9f9ec5ab82af5/lean/OeisA112970FC.lean#L48-L54"]
theorem conjecture3 (n : ℕ) : a (2^n - 1) = 1 := by
sorry
end OeisA112970
To prove it: keep every definition of Challenge.lean unchanged and prove OeisA112970.conjecture1 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_conjecture1 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.
nosorry fetch oeis-112970 nosorry submit oeis-112970 nosorry/oeis-112970/Solution.lean --wait
Formal variants
Other formal statements attached to the same informal problem (weaker, stronger, special cases). Each is scored separately.
- conjecture1-value — known result
- conjecture2 — known result
- conjecture3 — known result
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.