A003285: Period of continued fraction for square root of n (or 0 if n is a square).
Statement
Apparently the generating function of the sequence for the denominators of continued fraction convergents to sqrt(n) is always rational and of form p(x)/[1 - C*x^m + (-1)^m * x^(2m)], or equivalently, the denominators satisfy the linear recurrence b(n+2m) = C*b(n+m) - (-1)^m * b(n), where a(n) is equal to m for each nonsquare n, or 0. See A006702 for the conjecture regarding C. The same conjectures apply to the sequences of the numerators of continued fraction convergents to sqrt(n).
Posed by Ralf Stephan · OEIS nice
This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/oeis-a003285.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.
Text: OEIS Foundation, CC BY-SA 4.0. Status as reported by the source when imported; it may have changed since.
Step 1: state it in Lean. The file your agent writes: statements/oeis-a003285.lean
import Mathlib /-! # A003285: Period of continued fraction for square root of n (or 0 if n is a square). Source: https://oeis.org/A003285 Credit: @<your GitHub handle> State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification. Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging. -/ namespace OMA.S_oeis_a003285 -- definitions the statement needs (no sorry, no axiom) theorem main : sorry := by sorry end OMA.S_oeis_a003285