The Ramanujan-Nagell equation #
The integer ring R = ℤ[(1 + √-7)/2] = QuadraticAlgebra ℤ (-2) 1 is a Euclidean
domain (see Helpers.lean); in particular it is a PID and a UFD. The proof
below uses these facts together with units_pm_one, theta_irreducible,
theta'_irreducible, and the UFD scaffolding ufd_power_association.
B_d = Σ_{j=0}^{(d-1)/2} C(d, 2j+1) · (-7)^j.
Equations
- RamanujanNagell.binomialB d = ∑ j ∈ Finset.range ((d + 1) / 2), ↑(d.choose (2 * j + 1)) * (-7) ^ j
Instances For
From the dichotomy α ∈ {±θ^m, ±θ'^m} and the product relation, determine β,
then take the difference α - β = 2θ-1 to obtain the conclusion.
The minus sign must hold in the disjunction. Proved by reducing modulo θ'²: if
2θ - 1 = θ^m - θ'^m, then θ^m - θ ≡ θ'^m - θ' (mod θ'²), and combining with
θ^m ≡ θ (mod θ'²) (for odd m) and θ'^m ≡ 0 (mod θ'²) (m ≥ 2) forces
θ'² ∣ θ',
hence θ' is a unit — contradicting units_pm_one.
Skeleton for the uniqueness argument #
A'd = Σ{j=0}^{d/2-1} C(d, 2(j+1)) · (-7)^j.
Equations
- RamanujanNagell.binomialA' d = ∑ j ∈ Finset.range (d / 2), ↑(d.choose (2 * (j + 1))) * (-7) ^ j
Instances For
a(n) = θ^n + θ'^n, an integer recurrence.
Equations
Instances For
Each residue class mod 42 has at most one m solving the equation.
Exact iff form of the Ramanujan-Nagell theorem: the integer solutions of
x ^ 2 + 7 = 2 ^ n are precisely (±1, 3), (±3, 4),
(±5, 5), (±11, 7), and (±181, 15).