AFTD Auto-Formalizing Theoretical Domains

hyperbinaryCountMod3

def

For nonnegative integers m and r, hyperbinaryCountMod3 m r is the sum of coefficients of the hyperbinary length polynomial H_m(z) over exponents j with j % 3 = r % 3.

Statement

noncomputable def hyperbinaryCountMod3 (m : ℕ) (r : ℕ) : ℤ
Defined in
scout/2611-01243-halving-partitions-and-hyperbinary-expansions.md:1191
Verified
03 Nov 2026
Axioms
none listed
Built on 1
  • hyperbinaryLengthPolyThe hyperbinary length polynomial H_m(z) satisfies H_0(z) = 1, H_{2m+1}(z) = z H_m(z), and H_{2m}(z) = H_m(z) + z^2 H_{m-1}(z) for m ≥ 1.

Read back from the Lean

hyperbinaryCountMod3 is a function that takes two natural numbers $m$ and $r$ and returns the integer obtained by summing the coefficients of the polynomial hyperbinaryLengthPoly m at all degrees $j$ in its support satisfying $j \equiv r \pmod 3$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The count N_r(m) of hyperbinary expansions of m of length congruent to r mod 3. -/
noncomputable def hyperbinaryCountMod3 (m : ℕ) (r : ℕ) : ℤ := Finset.sum ((hyperbinaryLengthPoly m).support.filter (fun j => j % 3 = r % 3))
    (fun j => (hyperbinaryLengthPoly m).coeff j)
See it in the graphDiscuss this resultChallenge it