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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:A cubic generating function with ternary substitution · a_2

Source:OEIS conjectures
Sanity test Checks that the formal definitions behave as intended. First verified proof: +1 points.
Statement:reviewed
Statement:

No informal statement.

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

Formal statement

theorem a_2 : a 2 = 1
Show the full Challenge.lean (120 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# A cubic generating function with ternary substitution

The coefficients of the generating function
$A(x)=x+x^2+(2A(x)^3+A(x^3))/3$, with constant term $a(0)=0$.

*References:*
- [A375439](https://oeis.org/A375439)
- [A038754](https://oeis.org/A038754)
- [Li26] Wentao Li, [Parity of A375439](https://github.com/VictorLiwentao/lean-oeis-proofs/blob/0a23974e54b90afd1453ef02c27cf8f617bad940/proofs/new-proofs/A375439/PROOF.md), 2026.
-/

@[expose] public section

namespace OeisA375439

/-- 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 cube of a power series with coefficient sequence $b$. -/
def conv3 (b : ℕ → ℕ) (n : ℕ) : ℕ :=
  ∑ k ∈ Finset.range (n + 1), conv2 b k * b (n - k)

/-- Coefficients obtained by substituting $x^3$ for $x$. -/
def subst3 (b : ℕ → ℕ) (n : ℕ) : ℕ :=
  if 3 ∣ n then b (n / 3) else 0

/-- Coefficients of $2B(x)^3+B(x^3)$. -/
def rhs (b : ℕ → ℕ) (n : ℕ) : ℕ :=
  2 * conv3 b n + subst3 b n

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

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

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

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

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

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

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

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

@[category test, AMS 11]
theorem a_6 : a 6 = 9 := by
  rw [a_eq]
  norm_num [rhs, conv3, conv2, subst3, Finset.sum_range_succ, a_0, a_1, a_2, a_3, a_4, a_5]

set_option linter.style.formal_proof_palomar false in
/--
"Conjecture: $a(n)$ is odd iff $n$ is in A038754, which consists of numbers of the form
$3^k$ and $2*3^k$."
- Paul D. Hanna, Aug 21 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/0a23974e54b90afd1453ef02c27cf8f617bad940/LeanOeisProofs/NewProofs/A375439.lean#L382"]
theorem conjecture (n : ℕ) (hn : 1 ≤ n) :
    Odd (a n) ↔ ∃ k : ℕ, n = 3 ^ k ∨ n = 2 * 3 ^ k := by
  sorry

end OeisA375439

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

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