A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Pell's Equation

Graduate Depth 79 in the knowledge graph I know this Set as goal
4topics build on this
378prerequisites beneath it
See this on the map →
Continued FractionsLinear Diophantine EquationsLagrange's Four-Square Theorem
pells-equation diophantine continued-fractions

Core Idea

Pell's equation x2 - Dy2 = 1 (D not a perfect square) has infinitely many integer solutions generated from a fundamental solution via the continued fraction expansion of √D. Solutions correspond to units in ℤ[√D].

Explainer

Pell's equation x² − Dy² = 1 is deceptively simple to write down, yet finding its integer solutions requires one of the most beautiful tools in number theory: continued fractions, your main prerequisite. You've studied how irrational numbers like √2 = [1; 2, 2, 2, ...] can be represented as infinite continued fractions, and how their convergents — the rational approximations you get by truncating the continued fraction — give extraordinarily good approximations to the irrational number. The connection to Pell's equation is that these same convergents produce the solutions.

To find the smallest positive solution (x₁, y₁), called the fundamental solution, expand √D as a continued fraction [a₀; a₁, a₂, ...] and compute its convergents pₖ/qₖ. The fundamental solution appears as (p_{s−1}, q_{s−1}), where s is the period of the continued fraction expansion. For D = 2: √2 = [1; 2, 2, 2, ...] with period 1, and the first convergent beyond a₀ is 3/2, giving x = 3, y = 2. Check: 3² − 2·2² = 9 − 8 = 1. ✓ For D = 3: √3 = [1; 1, 2, 1, 2, ...] with period 2, and the convergent at period end is 2/1, giving x = 2, y = 1. Check: 4 − 3 = 1. ✓

What makes Pell's equation remarkable is that from just one fundamental solution, you generate infinitely many. All solutions are given by xₙ + yₙ√D = (x₁ + y₁√D)ⁿ. This algebraic structure — multiplying together expressions in the ring ℤ[√D] — reflects the fact that solutions are units (invertible elements) in that ring: if α = x₁ + y₁√D satisfies αᾱ = 1 (where ᾱ = x₁ − y₁√D), then αⁿ also satisfies this, generating a new solution. The multiplication rule corresponds to a matrix recurrence, and the solutions grow exponentially.

The reason continued fractions find the fundamental solution goes deeper than it might appear. The convergents pₖ/qₖ of √D are the best rational approximations to √D, meaning pₖ/qₖ ≈ √D, or equivalently pₖ ≈ qₖ√D, or pₖ² ≈ Dqₖ². The error in this approximation is so small — governed by the theory of continued fractions — that pₖ² − Dqₖ² lands exactly on 1 at the right index. The entire theory of Pell's equation is in some sense a story about how well rational numbers can approximate square roots of integers, and continued fractions are the perfect language for that story.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesSet Operations: Union, Intersection, and ComplementProof by CasesProving by Cases and ExhaustionVacuous Truth and Trivial CasesProof by Cases (Proof by Exhaustion)Mathematical InductionDivisibility and Greatest Common DivisorThe Fundamental Theorem of ArithmeticDivisibility Theory (Formal Treatment)Bézout's IdentityLinear Diophantine EquationsPell's Equation

Longest path: 80 steps · 378 total prerequisite topics

Prerequisites (2)

Leads To (1)