Title:A differential generating function
Statement:"Conjecture: is odd iff is a power of for ."
- Paul D. Hanna, Jul 03 2026.
Lean formalization by Wentao Li, with AI assistance; see [Li26].
| Subjects: | Number Theory (math.NT) |
| MSC classes: | 11 |
| Tags: | formal_proof |
| Cite as: | NS.06497 [math.NT] · NS.06497v1 for this version |
| Declaration: | OeisA397588.conjecture_parity |
| Verification: | Lean kernel (formal proof) |
| Points: | first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60 |
| Statement hash: | cbde5aaa1707e9b2b4206f84026ec56498fe1fe6a6b22a635e2f31c8c07cc553 |
| Toolchain: | leanprover/lean4:v4.33.1 |
| Licence: | Apache-2.0 · google-deepmind/formal-conjectures contributors |
| Upstream: | FormalConjectures/OEIS/397588.lean |
Formal statement
theorem conjecture_parity (n : ℕ) (hn : 1 ≤ n) :
Odd (a n) ↔ ∃ k : ℕ, n = 2 ^ kShow the full Challenge.lean (124 lines) — definitions included
module
public import FormalConjecturesUtil
/-!
# A differential generating function
The generating function satisfies $A(x)=x+(xA(x)^2)'$. Its constant term is zero.
Seiichi Manyama's recurrence is $a(1)=1$ and
$a(n)=(n+1)\sum_{k=1}^{n-1}a(k)a(n-k)$ for $n>1$.
*References:*
- [A397588](https://oeis.org/A397588)
- [Li26] Wentao Li, [Parity and divisibility for A397588](https://github.com/VictorLiwentao/lean-oeis-proofs/blob/0a23974e54b90afd1453ef02c27cf8f617bad940/proofs/new-formalization/A397588/PROOF.md), 2026.
-/
@[expose] public section
namespace OeisA397588
/-- Manyama's coefficient recurrence, extended by $a(0)=0$. -/
def a : ℕ → ℕ
| 0 => 0
| 1 => 1
| n + 2 =>
(n + 3) * ∑ k ∈ (Finset.Icc 1 (n + 1)).attach, a k.1 * a (n + 2 - k.1)
termination_by n => n
decreasing_by
· exact Nat.lt_succ_of_le (Finset.mem_Icc.mp k.2).2
· exact Nat.sub_lt (Nat.succ_pos _) (Finset.mem_Icc.mp k.2).1
/-- The recurrence without attached membership proofs. -/
@[category API, AMS 11]
theorem a_succ_succ (n : ℕ) :
a (n + 2) = (n + 3) * ∑ k ∈ Finset.Icc 1 (n + 1), a k * a (n + 2 - k) := by
simp only [a]
exact congrArg (fun t => (n + 3) * t)
(Finset.sum_attach (Finset.Icc 1 (n + 1)) (fun k => a k * a (n + 2 - k)))
/-- Manyama's recurrence for every index greater than one. -/
@[category API, AMS 11]
theorem a_of_gt_one {n : ℕ} (hn : 1 < n) :
a n = (n + 1) * ∑ k ∈ Finset.Icc 1 (n - 1), a k * a (n - k) := by
cases n with
| zero => omega
| succ n =>
cases n with
| zero => omega
| succ n => simp [a_succ_succ]
@[category test, AMS 11]
theorem a_0 : a 0 = 0 := by
simp only [a]
@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by
simp only [a]
@[category test, AMS 11]
theorem a_2 : a 2 = 3 := by
have hI : Finset.Icc (1 : ℕ) (2 - 1) = {1} := by decide
rw [a_of_gt_one (by decide : 1 < 2), hI]
norm_num [a_1]
@[category test, AMS 11]
theorem a_3 : a 3 = 24 := by
have hI : Finset.Icc (1 : ℕ) (3 - 1) = {1, 2} := by decide
rw [a_of_gt_one (by decide : 1 < 3), hI]
norm_num [a_1, a_2]
@[category test, AMS 11]
theorem a_4 : a 4 = 285 := by
have hI : Finset.Icc (1 : ℕ) (4 - 1) = {1, 2, 3} := by decide
rw [a_of_gt_one (by decide : 1 < 4), hI]
norm_num [a_1, a_2, a_3]
@[category test, AMS 11]
theorem a_5 : a 5 = 4284 := by
have hI : Finset.Icc (1 : ℕ) (5 - 1) = {1, 2, 3, 4} := by decide
rw [a_of_gt_one (by decide : 1 < 5), hI]
norm_num [a_1, a_2, a_3, a_4]
set_option linter.style.formal_proof_palomar false in
/--
"Conjecture: $a(n)$ is odd iff $n$ is a power of $2$ for $n \ge 1$."
- Paul D. Hanna, Jul 03 2026.
Lean formalization by Wentao Li, with AI assistance; see [Li26].
-/
@[category research solved, AMS 11,
formal_proof using lean4 at "https://github.com/VictorLiwentao/lean-oeis-proofs/blob/0a23974e54b90afd1453ef02c27cf8f617bad940/LeanOeisProofs/NewFormalization/A397588.lean#L211"]
theorem conjecture_parity (n : ℕ) (hn : 1 ≤ n) :
Odd (a n) ↔ ∃ k : ℕ, n = 2 ^ k := by
sorry
set_option linter.style.formal_proof_palomar false in
/--
"$a(n)$ divisible by $3$ for $n > 1$."
- Paul D. Hanna, Jul 03 2026.
Lean formalization by Wentao Li, with AI assistance; see [Li26].
-/
@[category research solved, AMS 11,
formal_proof using lean4 at "https://github.com/VictorLiwentao/lean-oeis-proofs/blob/0a23974e54b90afd1453ef02c27cf8f617bad940/LeanOeisProofs/NewFormalization/A397588.lean#L325"]
theorem three_dvd_a (n : ℕ) (hn : 1 < n) : 3 ∣ a n := by
sorry
end OeisA397588
To prove it: keep every definition of Challenge.lean unchanged and prove OeisA397588.conjecture_parity with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_conjecture_parity : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.
nosorry fetch oeis-397588 nosorry submit oeis-397588 nosorry/oeis-397588/Solution.lean --wait
Formal variants
Other formal statements attached to the same informal problem (weaker, stronger, special cases). Each is scored separately.
- three-dvd-a — 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.