Vous êtes sur la page 1sur 11

NUMBER THEORY

UNIT 5
1. Introduction

CONTINUED FRACTIONS

What is a continued fraction? Two examples are


1 1+ 1 1 1+ 2

and 4 +
3+

1 1 2+ 1 1

In this unit, we shall see how a number could be changed to a continued fraction and how this method is related to the Euclidean algorithm we learnt in Unit 1. Furthermore, we will look into some properties of continued fractions.

2. Definitions

Definition 2.1. A continued fraction x is a number expressed in the form


x = a0 + 1 a1 + 1 a2 + 1 O+ 1 an

where ai > 0 for all i > 0 and a0 0 . If the series a1 , , an is finite, the above representation of x is called a finite continued fraction. If the series is not finite, it is called an infinite continued fraction. We denote the continued fraction by [a0 , a1 , K , an ] for a finite continued fraction and [a0 , a1 , K , an , K] for an infinite continued fraction.

Illustration:
1+

1 1 2+ 1 3

= [0, 1, 2, 3] is a finite continued fraction.

Page 1 of 11

Mathematical Database

1+ 2+

1 1 2+ 1 2+ 1 O

= [1, 2, 2, 2, K] is an infinite continued fraction.

3. Continued Fractions and Euclidean Algorithm

Before we proceed to the relationship between Euclidean algorithm and continued fractions, let us look at the following example.

Example 3.1. Convert


7 11

and

11 8

into continued fractions.

Solution.
7 1 1 1 1 1 1 = 0+ = 0+ = 0+ = 0+ = 0+ = 0+ 11 4 1 1 1 1 11 1+ 1+ 1+ 1+ 1+ 7 3 1 1 7 7 1+ 1+ 1+ 4 1 4 4 1+ 3 3

Thus we can write Also, we have

7 = [0, 1, 1, 1, 3] . 11

11 3 1 1 1 1 = 1+ = 1+ = 1+ = 1+ = 1+ = [1, 2, 1, 2] . 8 2 1 1 8 8 2+ 2+ 2+ 3 1 3 3 1+ 2 2

As you may notice, the process of finding the continued fraction involves dividing the denominator by the numerator and after taking the quotient, the numerator becomes the denominator in the next step.

This is the idea of Euclidean algorithm, which has been discussed as Theorem 2.3 of Unit 1. It is stated below for reference.

Page 2 of 11

Mathematical Database

Theorem 3.1. (Euclidean algorithm) Let a and b be positive integers, a > b. Then we apply a series of divisions as follows. a = bq0 + r1 b = r1q1 + r2 r1 = r2 q2 + r3 M rn 2 = rn 1qn 1 + rn rn 1 = rn qn + rn +1 0 < r1 < b 0 < r2 < r1 0 < r3 < r2 M 0 < rn < rn1

The process of division comes to an end when rn +1 = 0 . The integer rn is the G.C.D. of a and b.

The equations in the Euclidean algorithm can be rewritten as


a = bq0 + r1 b = r1q1 + r2 r1 = r2 q2 + r3 M rn 2 = rn 1qn 1 + rn rn 1 = rn qn + rn +1 a r = q0 + 1 b b r b = q1 + 2 r1 r1 r r1 = q2 + 3 r2 r2 M rn 2 r = qn 1 + n rn 1 rn 1 rn 1 = qn rn

With the Euclidean algorithm, we have a r 1 1 = q0 + 1 = q0 + = q0 + b r b b q1 + 2 r1 r1 = q0 + 1 1 q1 + r1 r2 = q0 + 1 q1 + 1 r q2 + 3 r2 = L = q0 + 1 q1 + 1 q2 + 1 O+ 1 qn 1 + 1 qn .

Thus any rational number x = fraction [q0 , q1 , K , qn ] .

a (a and b are relatively prime) can be written as the continued b

Page 3 of 11

Mathematical Database

4. Convergents of Continued Fractions

Definition 4.1. Let x = [q0 , q1 , K , qn ] be the continued fraction representation of a rational number x. The integers q0 , q1 , , qn are called the partial quotients of x. The fractions

0 = [q0 ] = q0 , 1 = [q0 , q1 ] = q0 +

1 1 , 2 = [q0 , q1 , q2 ] = q0 + 1 q1 q1 + q2 1 , , n = [q0 , q1 , K , qn ] = q0 + 1 q1 + 1 q2 + 1 O+ 1 qn 1 + qn

are called convergents of x, where i is the i-th convergent of x.

Illustration: Referring to Example 3.1, we have


7 1 = 0+ 1 11 1+ 1+

1 1 3

1+

and from the above definitions,

0 = 0 , 1 = 0 + = 1 , 2 = 0 +

1 1

1 1 2 , 3 = 0 + = 1 2 1 3 1+ 1+ 1 1 1+ 1 1 7 and 4 = 0 + = . 1 11 1+ 1 1+ 1 1+ 3 =

Theorem 4.1. Let x = [q0 , q1 , K , qn ] be a rational number with the i-th convergent i = [q0 , q1 , K , qi ] . Let P1 = 1 , P0 = q0 , Q1 = 0 , Q0 = 1 and define Pk = qk Pk 1 + Pk 2 and Qk = qk Qk 1 + Qk 2 for k > 0 . Then for
0in,
Pi Qi

= i .
Page 4 of 11

Mathematical Database

Pi Proof. We shall prove this theorem by mathematical induction. Let S (i ) be the statement Q = i i

for 0 i n . For i = 0 , we have 0 = [q0 ] =


q0 1

P0 Q0

.
q1q0 +1 q1 1+ 0

For i = 1 , we have 1 = [q0 , q1 ] = q0 + q11 = Thus S (0) and S (1) are both true.

q1 P0 + P1 q1Q0 + Q1

P 1 Q1

Suppose S (k ) is true for some 0 k < n , i.e. k = gives k +1 . Thus we have

Pk Qk

qk Pk 1 + Pk 2 qk Qk 1 + Qk 2

. Then replacing qk by qk + qk1+1

k +1 = [q0 , q1 , K , qk , qk +1 ] = q0 +

1 q1 + 1 O+ 1 qk + 1 qk +1

1 qk + Pk 1 + Pk 2 qk +1 1 = q0 , q1 , K , qk + = q + k 1 q + 1 Q + Q k k 1 k 2 qk +1 (q q + 1) Pk 1 + qk +1 Pk 2 q (q P + Pk 2 ) + Pk 1 = k k +1 = k +1 k k 1 (qk qk +1 + 1)Qk 1 + qk +1Qk 2 qk +1 (qk Qk 1 + Qk 2 ) + Qk 1 = Thus S (k + 1) is also true. This completes the induction. Q.E.D. qk +1 Pk + Pk 1 . qk +1Qk + Qk 1

With the above convergents, we can compute the continued fraction in the form of a table.

n qk Pk Qk

0 q0

1 q1 P 1 Q1

n1 qn 1 Pn 1 Qn 1

n qn Pn Qn

1 0

P0 1

Page 5 of 11

Mathematical Database

Example 4.1. Find the continued fraction and the convergents for
81 . 35

Solution. By Euclidean algorithm, we have


81 = 35 2 + 11 35 = 11 3 + 2 11 = 2 5 + 1 2 = 1 2 81 1 is 2 + . 1 35 3+ 1 5+ 2

Thus the continued fraction of

We have the following table.

n qk Pk Qk

0 2

1 3 7 3

2 5 37 16

3 2 81 35

1 0

2 1

Thus the convergents are

2 7 37 81 , , and . 1 3 16 35

Theorem 4.2. For k > 0 , the difference between consecutive convergents is k k 1 = (1) k 1 . Qk Qk 1

Proof. For k > 0 , we have k k 1 = Then

Pk Qk

Pk 1 Q = k 1

Pk Qk 1 Pk 1Qk Qk Qk 1

hk Qk Qk 1

, where hk = Pk Qk 1 Pk 1Qk .

Page 6 of 11

Mathematical Database

hk = Pk Qk 1 Pk 1Qk = (qk Pk 1 + Pk 2 )Qk 1 Pk 1 (qk Qk 1 + Qk 2 ) = Pk 2Qk 1 Pk 1Qk 2 = hk 1. Thus hk = (1) k h0 and we have h0 = P0Q1 P1Q0 = 1 and so hk = (1) k 1 . Finally, k k 1 = hk (1)k 1 = . Qk Qk 1 Qk Qk 1 Q.E.D.

Corollary 4.3. Let x = [q0 , q1 , K , qn ] . Then for 0 k < n ,

k < x k > x

if k is even if k is odd

Corollary 4.4.
1 Let x = [q0 , q1 , K , qn ] . Then | k x | Qk Q for k > 0 . k 1

Note that since Pk Qk 1 Qk Pk 1 = hk = (1) k , ( Pk , Qk ) = 1 and hence the convergent lowest term.

Pk Qk

is in the

Theorem 4.5.

Let x = [q0 , q1 , K , qn ] . Then | k x | < | k 1 x | for k > 0 .

Proof. We have

Page 7 of 11

Mathematical Database

x = [q0 , q1 , K , qk 1 , qk , K , qn ] = q0 + 1 q1 + 1
O+

1 qk 1 + 1 qk + 1
O+

1 qn

= q0 +

1 q1 + 1
O+

1 qk 1 + 1 y

where
y = qk + 1 1 O+ qn

Now with the definition of Pk and Qk , x = q0 + 1 q1 + 1


O+

= [q0 , q1 , K , qk 1 , y ] = 1 1 y

yPk 1 + Pk 2 yQk 1 + Qk 2

qk 1 +

Thus x( yQk 1 + Qk 2 ) = yPk 1 + Pk 2 y ( xQk 1 Pk 1 ) = Pk 2 xQk 2 P P yQk 1 x k 1 = Qk 2 k 2 x Qk 1 Qk 2


Pk 1 Pk 2 |<| Q x| Since y > 1 , Qk 1 = qk 1Qk 2 + Qk 2 > Qk 2 > 0 , we have yQk 1 > Qk 2 and hence | x Q k 1 k 2 Pk 1 and and x Q k 1

Pk 2 Qk 2

x have the same sign. Q.E.D.

5. Infinite Continued Fraction

It has been shown that a rational number x can be expressed as a finite continued fraction and it is obvious that a finite continued fraction is a rational number. For irrational numbers, the idea of
Page 8 of 11

Mathematical Database

taking quotients can be applied and we would get an infinite continued fraction. In this section, we will see some properties of such continued fractions.

Let x = [q0 , q1 , K] be an infinite continued fraction. Then Theorem 4.5 also holds. As k , Qk as well and hence we have P P lim k k 1 = 0 . k Q k Qk 1 Also, from Corollary 4.3 and 4.4, it can be shown that
k P0 Q0

<

P2 Q2

<

P4 Q4

< L and

P 1 Q1

>

P3 Q3

>

P5 Q5

>L

Pk are two sequences converging to x and hence we have x = lim Q . k

Furthermore, Corollary 4.4 holds for infinite continued fraction and we can use this for writing the first few convergents of an irrational number, as well as convergents to a certain degree of accuracy. Below is an example.

Example 5.1.

Find a convergent of

2 with maximum error 0.001.

Solution.

We first find the convergents of the approximate value of the required accuracy.

2 and we shall then stop when we get

We shall take 9 decimal places approximation, i.e. 1.414213562. Then we have


1.41423562 = 1 + 0.41423562 = 1 + 1 2.41413563 1 1 = 1+ = 1+ 1 2 + 0.41413563 2+ 2.41421356 1 1 = 1+ = 1+ 1 1 2+ 2+ 1 2 + 0.41421356 2+ 2.414213576 1 = 1+ 1 2+ 1 2+ 2 + 0.414213576

Page 9 of 11

Mathematical Database

We have the following table for convergents:


n qk Pk Qk

0 1

1 2 3 2

2 2 7 5

3 2 17 12

4 2 41 29 and 5 =

5 2 99 70

1 0

1 1

7 17 Thus the first six convergents are 0 = 1 , 1 = 3 2 , 2 = 5 , 3 = 12 , 4 =

41 29

99 70

Now we are going to show that indeed of the required accuracy. Corollary 4.4 also applies to infinite continued fractions (try to prove this yourself!) and thus for 1 k > 0 , | k x | Qk Q . k 1 Putting k = 5 , we get | 5 2 |
1 2970

< 0.001 .

6. Exercises
1. 2. Convert
14 17

and

28 9

into continued fractions.

Suppose a and b are two relatively prime positive integers. Convert 2a 2 b + a 2 + ab + 2a + 1 2ab + a + 2 into its continued fraction.

3.

Prove that there exists a unique representation for any positive rational number in the form of a continued fraction.

4.

Find the convergents of

16 27

5.

Show that Corollary 4.4 applies to infinite continued fractions.

6.

(a) Determine an integer n for which the n th convergent of x = 0.5 + 7 approximates x with a maximum error of 0.005. (b) For the number n found in part (a), compute the n th convergent of x.
Page 10 of 11

Mathematical Database

7.

In this exercise we will consider the continued fraction


x = 2+

1 1 2+ 2 +L

= [ 2, 2, 2, ...] .

(a) Using mathematical induction or otherwise, prove that


k k 3 2 3 2 and 1 1 2 1 1 2 Pk = + + + 4 4 k 1 k 1 3 2 3 2 . 1 1 2 1 1 2 Qk = + + + 4 4

(b) Using x = lim

Pk , or otherwise, show that x = 1 + 2 . Qk

Page 11 of 11

Vous aimerez peut-être aussi