Ramanujan's Lost Notebook Part V, Ch. 16: rrcfDen
DefinitionRamanujanLostNotebook_PartV_ch16_rrcfDennumber-theoryramanujan-lost-notebook
Denominator B_n of the n-th convergent of
1 + a x / (1 + a x^2 / (1 + ⋯ + a x^n / 1)): B_n = B_{n-1} + a x^n B_{n-2}, B_0 = 1,
B_1 = 1 (p. 359); the book's Q_n(a) of (16.2.8). The reciprocal continued fraction
1 / (1 + a x / (1 + ⋯ + a x^n / 1)) has numerator B_n and denominator A_n (the
numerator of the convergent, given by the same recurrence started at A_0 = 1,
A_1 = 1 + a x). B_{n+1} for the parameter a equals A_n for the parameter a x.
A polynomial in a, x: no domain restriction, no junk value.
Reference: rrcfDen a x 2 = 1 + a x^2, rrcfDen 1 x 3 = 1 + x^2 + x^3.
Definition code
import Mathlib
namespace RamanujanLostNotebook.PartV
/-- Denominator `B_n` of the `n`-th convergent of
`1 + a x / (1 + a x^2 / (1 + ⋯ + a x^n / 1))`: `B_n = B_{n-1} + a x^n B_{n-2}`, `B_0 = 1`,
`B_1 = 1` (p. 359); the book's `Q_n(a)` of (16.2.8). The reciprocal continued fraction
`1 / (1 + a x / (1 + ⋯ + a x^n / 1))` has numerator `B_n` and denominator `A_n` (the
numerator of the convergent, given by the same recurrence started at `A_0 = 1`,
`A_1 = 1 + a x`). `B_{n+1}` for the parameter `a` equals `A_n` for the parameter `a x`.
A polynomial in `a`, `x`: no domain restriction, no junk value.
Reference: `rrcfDen a x 2 = 1 + a x^2`, `rrcfDen 1 x 3 = 1 + x^2 + x^3`. -/
noncomputable def rrcfDen (a x : ℂ) : ℕ → ℂ
| 0 => 1
| 1 => 1
| (n + 2) => rrcfDen a x (n + 1) + a * x ^ (n + 2) * rrcfDen a x n
end RamanujanLostNotebook.PartV
Source
G. E. Andrews and B. C. Berndt, Ramanujan's Lost Notebook, Part V, Springer 2018, Chapter 16.