We start with the definition of the Legendre Symbol
Defintion (Continued Fraction)
A continued fraction is an expression of the form
$$
\begin{align}
a_0 + \cfrac{1}{a_1
+ \cfrac{1}{a_2
+ \cfrac{1}{a_3
+ \cdots}}}
\end{align}
$$
where \(a_0\) is an integer and \(a_1, a_2, a_3, \ldots\) are positive integers.
Example 1
We can write \(\pi\) as \([3; 7, 15, 1, 292, \ldots]\) as follows
$$
\begin{align}
\pi
= 3 + \cfrac{1}{\,7
+ \cfrac{1}{\,15
+ \cfrac{1}{\,1
+ \cfrac{1}{292 + \cdots}}}}
\end{align}
$$
Example 2
Write the rational number \(\frac{37}{13}\) as a continued fraction. To do this, first write
$$
\begin{align}
\frac{37}{13} = 2 + \frac{11}{13}
\end{align}
$$
Note here that we can re-write \(\frac{11}{13}\) as follows
$$
\begin{align}
\frac{37}{13} = 2 + \frac{1}{\frac{13}{11}}
\end{align}
$$
But \(13/11 = 1 + \frac{2}{11}\). Hence
$$
\begin{align}
\frac{37}{13} = 2 + \frac{1}{\frac{13}{11}}
\end{align}
$$