In this section we use continued fractions ([2]) for expansion of rational numbers. If
,
,
, are integer nunbers with
for every
then ![\displaystyle [x_0;x_1,x_2,\ldots,x_n]\in\mathbb{Q},\quad\forall n\geq 0.](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+%5Bx_0%3Bx_1%2Cx_2%2C%5Cldots%2Cx_n%5D%5Cin%5Cmathbb%7BQ%7D%2C%5Cquad%5Cforall+n%5Cgeq+0.&bg=ffffff&fg=000000&s=0&c=20201002)
Conversly, we have the theorem
Theorem 1. Let
and
be coprime integers with
. Then there are non negative integer
and integers
,
,
,
such that
(1)
for every
.
(2)
.
Proof. Let us proceed by induction on
. The case
is trivial. Now suppose that the assertion is true for all positive integers up to
(
). Because
and
, we have
. Hence by the Division Algorithm ([1]), there are integers
and
such that

By the hypothesis of the induction, there are integers
,
,
,
,
such that
![\displaystyle \frac{s}{b}=[a_1;a_2,a_3,\ldots,a_m].\quad\quad (2)](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+%5Cfrac%7Bs%7D%7Bb%7D%3D%5Ba_1%3Ba_2%2Ca_3%2C%5Cldots%2Ca_m%5D.%5Cquad%5Cquad+%282%29&bg=ffffff&fg=000000&s=0&c=20201002)
Because
, we have
. From (1) and (2) we have
completing the induction step. 
The equality in the theorem is called an expansion of
into a finite continued fraction. In that expansion we will call
is the
th convergent of the continued fraction, or
th convergent of
.
Example 1. Find an expansion of
into a finite continued fraction.
Solution. By the Division Algorithm, we have
and
and
. Therefore
. 
The theorem says that for every rational number has an expansion into a finite continued fraction. But this expansion is not unique.
Example 2.
. 
Theorem 2. Let
be an integer number. Then
has exactly two expansions into a finite continued fraction.
Proof. By the theorem 1, we can write
where
,
,
,
are integers such that
for every
. If
then
and
is an expansion of
. If
then
, hence
is an integer, so
. Therefore
is an expansion of
.
Now assume that
. We have
is an integer number and
, hence
. This claim is false because
and
for every
. 
Theorem 3. Let
be a rational number but not an integer. Then
has exactly two expansions into a finite continued fraction.
Proof. Assume that
, where
and
are coprime integers. We prove by induction on
that
has exactly two expansions into a finite continued fraction
where
. If
, because
there is an integer
such that
. By the theorem 1, we can write
where
,
,
,
are integers such that
for every
. We have
and
, hence
. By the theorem 2, we have
has exactly two expansions into a finite continued fraction, those are
and
, therefore
has exactly two expansions
hence the claim is true for
. Now suppose that the claim is true for
,
,
,
(
). By the theorem 1, we can write
![\displaystyle \alpha=[a_0;a_1,a_2,\ldots,a_n],](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+%5Calpha%3D%5Ba_0%3Ba_1%2Ca_2%2C%5Cldots%2Ca_n%5D%2C&bg=ffffff&fg=000000&s=0&c=20201002)
where
,
,
,
are integers such that
for every
. We have
and
(integer part of
), hence
By the Division Algorithm, there is an integer
such that
and
, then
![\displaystyle \frac{s}{a}=[a_1;a_2,\ldots,a_n].](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+%5Cfrac%7Bs%7D%7Ba%7D%3D%5Ba_1%3Ba_2%2C%5Cldots%2Ca_n%5D.&bg=ffffff&fg=000000&s=0&c=20201002)
If
then
and by the theorem 2, we have
has exactly two expansions are
and
. If
then by the hypothesis of the induction (note that
and
are coprime integers),
has exactly two expansions are
![\displaystyle \frac{s}{a}=[a_1;b_2,\ldots,b_n]=[a_1;b_2,\ldots,b_n-1,1],](https://s0.wp.com/latex.php?latex=%5Cdisplaystyle+%5Cfrac%7Bs%7D%7Ba%7D%3D%5Ba_1%3Bb_2%2C%5Cldots%2Cb_n%5D%3D%5Ba_1%3Bb_2%2C%5Cldots%2Cb_n-1%2C1%5D%2C&bg=ffffff&fg=000000&s=0&c=20201002)
where
. Therefore
has exactly two expansions, and the claim is true for
. 
References
[1] https://nttuan.org/2020/01/14/divisibility/
[2] https://nttuan.org/2008/11/14/continued-fraction-expansion-of-rational-numbers/