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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:A generating function with powers two and four

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: a(n)a(n) is odd when n=2k−1n = 2^k - 1 for k≥0k \ge 0, and even elsewhere."

  • Paul D. Hanna, Jan 10 2024.

Lean proof by Wentao Li, with AI assistance; see [Li26].

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

Formal statement

theorem conjecture (n : ℕ) : Odd (a n) ↔ ∃ k : ℕ, n = 2 ^ k - 1
Show the full Challenge.lean (104 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# A generating function with powers two and four

The sequence consists of the coefficients of
$A(x)=1+x(A(x)^2+A(-x)^2)/2+x(A(x)^4-A(-x)^4)/2$.

*References:*
- [A368629](https://oeis.org/A368629)
- [Li26] Wentao Li, [Generating-function bridge and parity for A368629](https://github.com/VictorLiwentao/lean-oeis-proofs/blob/9d4a205da2a4094800f9c600a7b0b5223eda51ce/proofs/new-proofs/A368629/PROOF.md), 2026.
-/

@[expose] public section

namespace OeisA368629

/-- Coefficients of the square of a power series with coefficient sequence $b$. -/
def conv2 (b : ℕ → ℕ) (n : ℕ) : ℕ :=
  ∑ k ∈ Finset.range (n + 1), b k * b (n - k)

/-- Coefficients of the fourth power of a power series with coefficient sequence $b$. -/
def conv4 (b : ℕ → ℕ) (n : ℕ) : ℕ :=
  conv2 (conv2 b) n

/-- Coefficients of $A(x)=1+x(A(x)^2+A(-x)^2)/2+x(A(x)^4-A(-x)^4)/2$. -/
def a : ℕ → ℕ :=
  Nat.strongRec fun n ih =>
    if n = 0 then 1
    else
      let b : ℕ → ℕ := fun m => if h : m < n then ih m h else 0
      if Even n then conv4 b (n - 1)
      else conv2 b (n - 1)

/-- The coefficient recurrence unfolded at an index. -/
@[category API, AMS 11]
theorem a_eq (n : ℕ) :
    a n = if n = 0 then 1 else
      if Even n then conv4 (fun m => if m < n then a m else 0) (n - 1)
      else conv2 (fun m => if m < n then a m else 0) (n - 1) := by
  rw [a, Nat.strongRec_eq]
  simp only [a, dite_eq_ite]

@[category test, AMS 11]
theorem a_0 : a 0 = 1 := by
  rw [a_eq]
  norm_num

@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by
  rw [a_eq]
  norm_num [conv4, conv2, Finset.sum_range_succ, a_0]

@[category test, AMS 11]
theorem a_2 : a 2 = 4 := by
  rw [a_eq]
  norm_num [conv4, conv2, Finset.sum_range_succ, a_0, a_1]

@[category test, AMS 11]
theorem a_3 : a 3 = 9 := by
  rw [a_eq]
  norm_num [conv4, conv2, Finset.sum_range_succ, a_0, a_1, a_2]

@[category test, AMS 11]
theorem a_4 : a 4 = 88 := by
  rw [a_eq]
  norm_num [conv4, conv2, Finset.sum_range_succ, a_0, a_1, a_2, a_3]

@[category test, AMS 11]
theorem a_5 : a 5 = 210 := by
  rw [a_eq]
  norm_num [conv4, conv2, Finset.sum_range_succ, a_0, a_1, a_2, a_3, a_4]

set_option linter.style.formal_proof_palomar false in
/--
"Conjecture: $a(n)$ is odd when $n = 2^k - 1$ for $k \ge 0$, and even elsewhere."
- Paul D. Hanna, Jan 10 2024.

Lean proof 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/9d4a205da2a4094800f9c600a7b0b5223eda51ce/LeanOeisProofs/NewProofs/A368629.lean#L463"]
theorem conjecture (n : ℕ) : Odd (a n) ↔ ∃ k : ℕ, n = 2 ^ k - 1 := by
  sorry

end OeisA368629

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