 , with
, with  and
 and 
 .  
Algorithm 1.1.13 gives:
.  
Algorithm 1.1.13 gives:
|  |  |  | |
|  |  |  | |
|  | |||
|  |  |  | |
|  |  | 
 for
 for  (also
 (also  since
 since 
 ).
Rewrite the equations as follows:
).
Rewrite the equations as follows:
|  |  | |
|  |  | |
|  |  | |
|  | ||
|  |  | 
![$\displaystyle \frac{a}{b} = [a_0,a_1,\ldots, a_n].
$](img1671.png) 
 
The proof of Proposition 5.1.14 leads to an algorithm for computing the continued fraction of a rational number.
A nonzero rational number can be represented in exactly two ways;
for example, 
![$ 2=[1,1] = [2]$](img1672.png) (see Exercise 5.2).
 (see Exercise 5.2).
William 2007-06-01