A finite regular continued fraction is an expression of the form
or
Expressing a real number x by its decimal expansion may seem very natural, but of course upon reflection it is an artifact of humans having 10 fingers. The expansion is clearly base-dependent, so that the integers that combine together to yield x would be quite different if we switched from base 10 to base 7. By contrast, note that a regular continued fraction for a real number x supplies an expansion of x in integers that is not base dependent. However strange it may appear on first glance, the continued expansion of x is in this sense more natural than the decimal expansion of x.
A continued fraction as above is a rational number,
say
.
If
is a sequence of integers
such that
, where
is a real number, then we say
has
regular (or simple) continued fraction
with
convergent
. Continued fractions occur
frequently in other parts of mathematics and even in the analysis of
feedback shift register sequences1.9.
so
Let
denote the greatest integer less than or equal to
,
called the integer part of
.
Given a rational number
, the following two methods will
find the continued fraction expansion.
step 1: Let
,
,
, and let
.
step 2: Let
, replace
by
.
step 3: If
then replace
by
and go to step
. If
then stop.
The following theorem says that this algorithm, for any rational number
, will terminate.
The proof uses the Euclidean algorithm.
proof:
We assume
is not an integer.
By adding or subtracting a suitable integer, we may assume that
. Let
, where
are relatively prime integers
and
. Recall the steps used in the Euclidean algorithm:
Let
and
. Let
,
.
step 1: Use the division algorithm to compute integers
and
such that
Let
step 2: If
then increment
and
go to step 1. If
then stop.
Since
, at some point the
above algorithm must terminate.
(a)
,
(b)
,
(c)
.
Find the continued fraction expansions of
(a)
,
(b)
.