# Thread: finite continued fractions ?

1. ## finite continued fractions ?

How to express the rational numbers as finite continued fractions ?
with last term >1

1. 118/303

2. 187/57

3. 10001/10101

4. 12/240005

2. $

\frac{{187}}
{{57}} = 3 + \frac{{16}}
{{57}} = 3 + \frac{1}
{{{\raise0.5ex\hbox{\scriptstyle {57}}
\kern-0.1em/\kern-0.15em
\lower0.25ex\hbox{\scriptstyle {16}}}}} = 3 + \frac{1}
{{3 + {\raise0.5ex\hbox{\scriptstyle 9}
\kern-0.1em/\kern-0.15em
\lower0.25ex\hbox{\scriptstyle {16}}}}} = 3 + \frac{1}
{{3 + \tfrac{1}
{{1 + \tfrac{7}
{9}}}}}

$

$
\frac{{187}}
{{57}} = 3 + \frac{1}
{{3 + \tfrac{1}
{{1 + \tfrac{7}
{9}}}}} = 3 + \frac{1}
{{3 + \tfrac{1}
{{1 + \tfrac{1}
{{1 + \tfrac{2}
{7}}}}}}} = 3 + \frac{1}
{{3 + \tfrac{1}
{{1 + \tfrac{1}
{{1 + \tfrac{1}
{{3 + \tfrac{1}
{2}}}}}}}}}

$

Do you see how I did it?

3. Here is another approach you can take.

Use the Euclidean algorithm on $187,57$:

$187 = 3\cdot 57 + 16$
$57 = 3\cdot 16 + 9$
$16 = 1\cdot 9 + 7$
$9 = 1\cdot 7+2$
$7 = 3\cdot 2 + 1$
$2 = 1\cdot 1+0$

Thus, $187/57 = [3;3,1,1,3,1]$.

Now why does this not match what PaulRS did?
Probably a computational mistake somewhere, I do not have time to check it now.

4. Originally Posted by ThePerfectHacker
$2 = 1\cdot 1+0$