![$ [a_0,\ldots,a_m]$](img1591.png) .  We do not assume
at this point that the
.  We do not assume
at this point that the  are integers.
 are integers.
 , the
, the  th convergent of the 
continued fraction
th convergent of the 
continued fraction 
![$ [a_0,\ldots,a_m]$](img1591.png) is
is 
![$ [a_0,\ldots, a_n]$](img1593.png) .  These convergents for
.  These convergents for  are
also called partial convergents.
 are
also called partial convergents.
For each  with
 with 
 , 
define real numbers
, 
define real numbers  and
 and  as follows:
 as follows:
 
 .  Suppose the
proposition is true for all continued fractions of length
.  Suppose the
proposition is true for all continued fractions of length  .  Then
.  Then
| ![$\displaystyle [a_0,\ldots, a_n]$](img1599.png) | ![$\displaystyle = [a_0,\ldots,a_{n-2}, a_{n-1} + \frac{1}{a_n}]$](img1600.png) | |
|  | ||
|  | ||
|  | ||
|  | ||
|  | 
 
sage: c = continued_fraction(pi,bits=33); c [3, 7, 15, 1, 292, 2] sage: c.convergents() [3, 22/7, 333/106, 355/113, 103993/33102, 208341/66317]As we will see, the convergents of a continued fraction are the best rational approximations to the value of the continued fraction. In the example above, the listed convergents are the best rational approximations of
 with given denominator size.
 with given denominator size. 
 is obvious from the definitions.
Now suppose
 is obvious from the definitions.
Now suppose  and the statement is true for
 and the statement is true for  .  Then
.  Then 
|  |  | |
|  | ||
|  | ||
|  | 
|  |  | |
|  | ||
|  | 
 
 is
 is 
 , and of
, and of 
 is
 is  
 .
.
 .
.
sage: c = continued_fraction(pi); c [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 3] sage: for n in range(-1, len(c)): ... print c.pn(n)*c.qn(n-1) - c.qn(n)*c.pn(n-1), 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 sage: for n in range(len(c)): ... print c.pn(n)*c.qn(n-2) - c.qn(n)*c.pn(n-2), 3 -7 15 -1 292 -1 1 -1 2 -1 3 -1 14 -3
![$ [a_0,a_1,\ldots, a_m]$](img1568.png) is a simple continued fraction,
so each
 is a simple continued fraction,
so each  is an integer, 
then the
 is an integer, 
then the  and
 and  are integers and 
the fraction
 are integers and 
the fraction  is in lowest terms.
 is in lowest terms. and
 and  are integers, from the formula
  that defines them.  If
 are integers, from the formula
  that defines them.  If  is a positive divisor of both
 is a positive divisor of both  and
 and
   , then
, then 
 , so
, so  .
.  
  
sage: c = continued_fraction([1,2,3,4,5]) sage: c.convergents() [1, 3/2, 10/7, 43/30, 225/157] sage: [c.pn(n) for n in range(len(c))] [1, 3, 10, 43, 225] sage: [c.qn(n) for n in range(len(c))] [1, 2, 7, 30, 157]
William 2007-06-01