Use the periodic continued fraction . A direct matrix argument avoids any assumption about the parity of the period. Let
Periodicity says that fixes as a Möbius transformation, while takes to . Thus has integer entries and fixes . Equating rational and irrational parts in gives . Consequently
The eigenvalue of on is its denominator ; this uses and , including the one-term period. The corresponding eigenvalue of is . If the algebraic norm is , square this unit; otherwise keep it. In either case there is a unit of algebraic norm with integer . Its powers have integer coefficients and algebraic norm , and are distinct since strictly increases. Hence Pell's equation has infinitely many integer solutions.
For , and . Iterating this Gauss continued-fraction map on an irrational number never reaches zero, and its continued fraction is
The branches have inverse , for . The change of variables formula for a probability density function gives, almost everywhere,
The endpoints of these branches are a countable set of probability zero. Thus and have the same distribution; this Gauss measure is an invariant measure for the Gauss continued-fraction map.
Suppose first that a simple continued fraction is eventually periodic. Its periodic tail is fixed by the Möbius transformation represented by the continued-fraction matrix of one full period:
Thus
The infinite tail is not rational, since a rational simple continued fraction terminates. Hence is a quadratic irrational, and the finite initial block expresses the original number as another rational Möbius transform of . Therefore every eventually periodic simple continued fraction represents a quadratic irrational.
For the purely periodic fraction ,
so . Positivity selects
Apply the continued-fraction algorithm to :
The complete quotient then repeats, giving
The convergents through one term before the final are
The last of these satisfies the Pell equation
so a positive solution is
Write the continued fraction as and define its convergents by
Induction using these recurrences gives
In particular, consecutive convergents have coprime numerator and denominator. The standard best-approximation consequence of the same determinant identity is that, for and ,
Dividing by gives
The contrapositive proves that any strictly better approximation has .
For , the continued-fraction algorithm gives
and the remainder then repeats. Hence
The convergent supplies a solution of the Pell equation:
Starting with , define
while the denominator is nonzero. This gives the simple continued fraction
A finite expansion is rational by evaluating it from the bottom. Conversely, for rational , these steps are the Euclidean algorithm applied to numerator and denominator, so the remainders eventually vanish.
Define convergents by
The recurrence gives
so induction yields
In particular,
Since an irrational lies strictly between these convergents, the two approximation errors sum to this distance. If both displayed bounds in the question failed, their sum would be at least
by the arithmetic-geometric mean inequality, contradicting strict betweenness. Thus at least one bound holds.
Directly,
Thus take , , , and . They are nonnegative and
Each finite block of a continued fraction acts by a fractional linear transformation with an integral matrix of determinant . If the block repeats, removing one period leaves the same tail , so
for integers . Hence , with the linear case allowed when .
For period ,
so
The continued fraction is positive, so it is the positive root
while the other root is negative.
The simple continued fraction algorithm for begins with . Its complete quotients repeat after
Thus
The convergents through one period are
The last one gives the negative Pell equation solution
Therefore
Pell equation 2026-09-29
For a nonsquare positive integer , the Pell equation is
Periodic continued fractions of produce infinitely many integer solutions.
Rational Dehn surgery 2026-10-06
For a null-homologous knot, choose a meridian of a knot and Seifert longitude . Rational surgery with relatively prime numerator and denominator fills the knot exterior along . A negative continued fraction for replaces this operation by integer surgery on a chain of meridians, using slam-dunk moves.