This course develops continued fractions as a bridge between the Euclidean algorithm, rational approximation, quadratic irrationals, and Pell equations. The guiding question is simple: when a real number is approximated by rationals, why do certain denominators give much better answers than their size would suggest?
text
admin
The chapters build the answer in stages. We first turn repeated division into finite continued fractions for rational numbers, then pass to infinite continued fractions for irrational numbers and prove that their convergents really recover the original number. The next chapters study why those convergents are arithmetically special: they give sharp error bounds, best-approximation properties, and the standard elementary route to Dirichlet and Hurwitz type estimates.
text
admin
The second half of the course focuses on structure and computation. Periodic continued fractions characterize quadratic irrationals, square roots have especially concrete period algorithms, and the period of $\sqrt{D}$ controls the Pell equations $x^2-Dy^2=1$ and $x^2-Dy^2=-1$. The final chapters collect exact computational certificates and a short optional synthesis through interval maps and matrix products.
text
admin
[remark: Recurring Computations]
Nearly every calculation in the course returns to three formulas: the recurrence for convergents, the determinant identity for adjacent convergents, and the error estimate involving consecutive denominators. Keeping these formulas visible makes the later theory computational rather than mysterious.
[/remark]
remark
admin
# 1. Euclidean Algorithm and Finite Continued Fractions
h1
admin
This opening chapter explains how continued fractions arise from the Euclidean algorithm. The only prerequisites are integer division with remainder, greatest common divisors, and basic manipulation of rational numbers. The guiding question is: when a rational number is divided repeatedly into integer and fractional parts, what information is preserved, and how can it be recovered? The answer is a finite list of positive integers after the first term, and this list gives both an exact expression for the rational number and a sequence of rational approximations called convergents.
text
admin
## From Division to Continued Fractions
h2
admin
The first problem is to encode repeated division without losing the quotients produced by the Euclidean algorithm. If $x>0$ is rational, write $x=a_0+r_0$ with $a_0\in\mathbb Z$ and $0\le r_0<1$. When $r_0\ne 0$, the reciprocal $1/r_0$ is again positive rational, so the same division step may be repeated.
text
admin
[definition: Finite Simple Continued Fraction]
Let $a_0\in\mathbb Z$ and let $a_1,\dots,a_n\in\mathbb N$. The finite simple continued fraction with partial quotients $a_0,a_1,\dots,a_n$ is the rational number
\begin{align*}
[a_0;a_1,\dots,a_n]=a_0+\frac{1}{a_1+\frac{1}{a_2+\cdots+\frac{1}{a_n}}}.
\end{align*}
[/definition]
definition
admin
The semicolon separates the integer part $a_0$ from the positive partial quotients that follow it. For positive rational numbers greater than $1$, $a_0$ is the first quotient in the Euclidean algorithm; for numbers in $(0,1)$, $a_0=0$ and the remaining data begins after taking a reciprocal.
text
admin
[example: Euclidean Expansion of 415 Over 93]
Consider the rational number
\begin{align*}
\frac{415}{93}.
\end{align*}
Applying division with remainder gives
\begin{align*}
415=4\cdot 93+43.
\end{align*}
The next divisions are
\begin{align*}
93=2\cdot 43+7,
\end{align*}
\begin{align*}
43=6\cdot 7+1,
\end{align*}
and finally
\begin{align*}
7=7\cdot 1+0.
\end{align*}
Dividing the first equality by $93$ gives
\begin{align*}
\frac{415}{93}=4+\frac{43}{93}.
\end{align*}
From $93=2\cdot 43+7$, division by $43$ gives
\begin{align*}
\frac{93}{43}=2+\frac{7}{43}.
\end{align*}
Taking reciprocals of both positive sides therefore gives
\begin{align*}
\frac{43}{93}=\frac{1}{2+\frac{7}{43}}.
\end{align*}
From $43=6\cdot 7+1$, division by $7$ gives
\begin{align*}
\frac{43}{7}=6+\frac{1}{7}.
\end{align*}
Taking reciprocals again gives
\begin{align*}
\frac{7}{43}=\frac{1}{6+\frac{1}{7}}.
\end{align*}
Substituting this into the previous reciprocal expression gives
\begin{align*}
\frac{43}{93}=\frac{1}{2+\frac{1}{6+\frac{1}{7}}}.
\end{align*}
Substituting this value of $43/93$ into the first decomposition yields
\begin{align*}
\frac{415}{93}=4+\frac{1}{2+\frac{1}{6+\frac{1}{7}}}.
\end{align*}
Thus, by the definition of a finite simple continued fraction,
\begin{align*}
\frac{415}{93}=[4;2,6,7].
\end{align*}
The partial quotients $4,2,6,7$ are exactly the nonzero quotients produced by the Euclidean algorithm, recorded in the same order.
[/example]
example
admin
The example gives a construction, but a representation theory also needs to answer whether the construction always stops and whether two different lists can name the same rational number. There is a genuine final-step ambiguity: when $a_n>1$,
The next theorem states that this is the only ambiguity and fixes it by requiring the last partial quotient to be greater than $1$.
text
admin
[quotetheorem:5500]
text
admin
[citeproof:5500]
text
admin
The uniqueness theorem tells us that the Euclidean algorithm is not merely a way of finding an expansion; after the final-term convention is imposed, it is the expansion. The hypotheses matter: positivity keeps the Euclidean process in the form used here, while rationality is what makes the chain of remainders terminate; irrational numbers require infinite continued fractions instead. If later partial quotients were allowed to be negative, even a positive rational would lose the standard convention: for instance