 and write
 and write
  
 
with
 and
 and 
 .  
We call the number
.  
We call the number  the floor of
 the floor of  , and
we also sometimes write
, and
we also sometimes write 
 .
If
.
If  , write
, write
 
with
 and
 and 
 .
Thus
.
Thus 
![$ t_0 = \frac{1}{a_1 + t_1}=[0,a_1+t_1]$](img1683.png) , which is a (non-simple)
continued fraction expansion of
, which is a (non-simple)
continued fraction expansion of  .  Continue in this manner
so long as
.  Continue in this manner
so long as  writing
 writing
 
with
 and
 and 
 .
We call this procedure, which associates to a real number
.
We call this procedure, which associates to a real number  the sequence
of integers
 the sequence
of integers 
 , the
continued fraction process.
, the
continued fraction process.
 .  Then
.  Then 
 , so
, so 
 and
 and 
 .  Then
.  Then
 , so
, so  and
 and 
 .
Then
.
Then 
 , so
, so  ,
,  , and the sequence terminates.
Notice that
, and the sequence terminates.
Notice that 
![$\displaystyle \frac{8}{3} = [2,1,2],$](img1700.png) 
so the continued fraction procedure produces the continued fraction of
 .
.
 Then
 Then 
 
so
 and
 and 
 .
We have
.
We have
 
so again
 and
 and 
 .
Likewise,
.
Likewise,  for all
 for all  .
As we will see below, the following exciting
equality makes sense.
.
As we will see below, the following exciting
equality makes sense.
 
sage: def cf(bits): ... x = (1 + sqrt(RealField(bits)(5))) / 2 ... return continued_fraction(x) sage: cf(10) [1, 1, 1, 1, 1, 1, 1, 3] sage: cf(30) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] sage: cf(50) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
 .  Using the continued
fraction procedure, we find that
.  Using the continued
fraction procedure, we find that
 
For example,
 is the floor of
 is the floor of  .  Subtracting
.  Subtracting  and inverting,
we obtain
 and inverting,
we obtain
 , so
, so  .  Subtracting
.  Subtracting  and inverting yields
and inverting yields 
 , so
, so 
 .  We will prove in Section 5.3 that the 
continued fraction of
.  We will prove in Section 5.3 that the 
continued fraction of  obeys a simple pattern.
 obeys a simple pattern.
The  th partial convergent of the continued fraction of
th partial convergent of the continued fraction of  is
 is 
![$\displaystyle [a_0,a_1,a_2,a_3,a_4,a_5] = \frac{87}{32} = 2.71875,
$](img1714.png) 
which is a good rational approximation to
 , in the
sense that
, in the
sense that 
 
Note that
 , which illustrates
the bound in Corollary 5.2.11 below.
, which illustrates
the bound in Corollary 5.2.11 below.
Let's do the same thing with 
 :
Applying the continued fraction procedure, we find that
the continued fraction of
:
Applying the continued fraction procedure, we find that
the continued fraction of  is
 is 
 
The first few partial convergents are
 
These are good rational approximations to
 ; for example,
; for example, 
 
Notice that the continued fraction of  exhibits a nice pattern (see
Section 5.3 for a proof), whereas the continued
fraction of
 exhibits a nice pattern (see
Section 5.3 for a proof), whereas the continued
fraction of  exhibits no pattern that is obvious to the author.
The continued fraction of
 exhibits no pattern that is obvious to the author.
The continued fraction of  has been extensively studied, and over
20 million terms have been computed.  The data suggests that every
integers appears infinitely often as a partial convergent.  For much
more about the continued fraction of
 has been extensively studied, and over
20 million terms have been computed.  The data suggests that every
integers appears infinitely often as a partial convergent.  For much
more about the continued fraction of  or of any other sequence
in this book, type the first few terms of the sequence  
into [#!sloane!#].
 or of any other sequence
in this book, type the first few terms of the sequence  
into [#!sloane!#].
William 2007-06-01