[Math] How to show every rational number can be expressed as two different continued fractions

continued-fractionsrational numbers

I am being asked to verify that every rational number can be represented by two different continued fractions.

I have started by taking any rational number, say $\alpha \in \mathbb{Q}$, and what I need to show is that we can have it expressed as two continued fractions:

\begin{equation}
\alpha = [a_0; a_1, a_2, \ldots, a_n] = [b_0; b_1, b_2, \ldots, b_m]
\end{equation}

(Where not all $a_i = b_i$ for all $i \in \mathbb{N}$).

I have verified the trivial case where if $\alpha = k \in \mathbb{Z}$, then we can always express it as:

\begin{equation}
\alpha = [k-1; 1] = [k]
\end{equation}

If $\alpha =\frac{p}{q} \in \mathbb{Q}$ where $p$ and $q$ are coprime integers, my intuition is that we could say:
\begin{equation}
\alpha = [a_0; a_1, a_2 \ldots]
\end{equation}
using the usual continued fraction algorithm, and then:
\begin{equation}
\alpha = [-1; [c_0; c_1, c_2, \ldots c_p]]
\end{equation}
Where $[c_0; c_1, c_2, \ldots, c_p] = \frac{1}{\alpha +1}$. If anyone has any thoughts it would be greatly appreciated!

Best Answer

If you have a sequence $[a_0,a_1,\cdots,a_n]$

you can replace it with

$$[a_0,a_1,\cdots,a_n-1,1]$$ in the case $a_n>1$ and with $$[a_0,a_1,\cdots,a_{n-1}+1]$$ in the case $a_n=1$. So we always have two different representations. Note that the first entry need not be positive.

For irrational numbers, the expansion is always unique.

Related Question