Continued Fractions 9780883856093, 9780883859261, 0883859262

Front Cover; Continued Fractions; Copyright Page; Contents; Preface; Chapter 1. Expansion of Rational Fractions; 1.1 Int

273 73 5MB

English Pages 171 pages [171] Year 2014

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Front Cover
Continued Fractions
Copyright Page
Contents
Preface
Chapter 1. Expansion of Rational Fractions
1.1 Introduction
1.2 Definitions and Notation
1.3 Expansion of Rational Fractions
1.4 Expansion of Rational Fractions (General Discussion)
1.5 Convergents and Their Properties
1.6 Differences of Convergents
1.7 Some Historical Comments
Chapter 2. Diophantine Equations
2.1 Introduction
2.2 The Method Used Extensively by Euler
2.3 The Indeterminate Equation ax --
by = 1
2.4 The General Solution of ax --
by = c, (a, b) = 1
2.5 The General Solution of ax + by = c, (a, b) = 1. 2.6 The General Solution of Ax By = C2.7 Sailors, Coconuts, and Monkeys
Chapter 3. Expansion of Irrational Numbers
3.1 Introduction
3.2 Preliminary Examples
3.3 Convergents
3.4 Additional Theorems on Convergents
3.5 Some Notions of a Limit
3.6 Infinite Continued Fractions
3.7 Approximation Theorems
3.8 Geometrical Interpretation of Continued Fractions
3.9 Solution of the Equation x2 = ax + 1
3.10 Fibonacci Numbers
3.11 A Method for Calculating Logarithms
Chapter 4. Periodic Continued Fractions
4.1 Introduction
4.2 Purely Periodic Continued Fractions. 4.3 Quadratic Irrationals4.4 Reduced Quadratic Irrationals
4.5 Converse of Theorem 4.1
4.6 Lagrange's Theorem
4.7 The Continued Fraction for N
4.8 Pell's Equation, x2 --
Ny2 = 1
4.9 How to Obtain Other Solutions of Pell's Equation
Chapter 5. Epilogue
5.1 Introduction
5.2 Statement of the Problem
5.3 Hurwitz' Theorem
5.4 Conclusion
Appendix I. Proof That x2 --
3y2 = --
1 Has No Integral Solutions
Appendix II. Some Miscellaneous Expansions
Solutions to Problems
References
Index.
Recommend Papers

Continued Fractions
 9780883856093, 9780883859261, 0883859262

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

Continued Fractions

37

 

+

+

1 11

151

++

1

292+1+

C. D. Olds Anneli Lax New Mathematical Library | Vol. 9

1

CONTINUED FRACTIONS

NEW MATHEMATICAL LIBRARY published by The Mathematical Association of America

Editorial Committee Basil Gordon, Chairman (1975-76) University of California, L.A . Ivan Niven (1975-77) M. M. Schiffer (1975-77)

Anneli Lax, Editor

New York University University of Oregon Stanford University

The New Mathematical Library (NML) was begun in 1961 by the School Mathematics Study Group to make available to high school students short expository books on various topics not usually covered in the high school syllabus. In a decade the NML matured into a steadily growing series of some twenty titles of interest not only to the originally intended audience, but to college students and teachers at all levels. Previously published by Random House and L. W. Singer, tne XML became a publication series of the Mathematical Association of America (MAA) in 1975. Under the auspices of the MAA the NML will continue to grow and will remain dedicated to its original and expanded purposes.

CONTINUED FRACTIONS bY

C. D. Olds San Jose State University

9 MATHEMATICAL ASSOCIATION O F AMERICA

Illustrations by Carl Bass ©Copyright 1963 by The Mathematical Association of America All rights reserved under International and Pan-American Copyright Conventions. Published in Washington, D.C. by The Mathematical Association of America Library of Congress Catalog Card Number: 61-12185 Print ISBN 978-0-88385-609-3 Electronic ISBN 978-0-88385-926-1 Manufactured in the United States of America

Note to the Reader

T

his book is one of a series written by professional mathematicians in order to make some important mathematical ideas interesting and understandable to a large audience of high school students and laymen. Most of the volumes in the New Mathematical Library cover topics not usually included in the high school curriculum; they vary in difficulty, and, even within a single book, some parts require a greater degree of concentration than others. Thus, while the reader needs little technical knowledge to understand most of these books, he will have to make an intellectual effort. If the reader has so far encountered mathematics only in classroom work, he should keep in mind that a book on mathematics cannot be read quickly. Nor must he expect to understand all parts of the book on first reading. He should feel free to skip complicated parts and return to them later; often an argument will be clarified by a subse quent remark. On the other hand, sections containing thoroughly familiar material may be read very quickly. The best way to learn mathematics is to do mathematics, and each book includes problems, some of which may require considerable thought. The reader is urged to acquire the habit of reading with paper and pencil in hand; in this way mathematics will become increasingly meaningful to him. The authors and editorial committee are interested in reactions to the books in this series and hope that readers will write to: Anneli Lax, Editor, New Mathematical Library, NEW YORKUNIVERSITY, THECOURANT INSTITUTE OF MATHEMATICAL SCIENCES, 251 Mercer Street, New York, N. Y. 10012.

The Editors

NEW MATHEMATICAL LIBRARY 1 Numbers: Rational and Irrational b y Zvon Niuen 2 What is Calculus About? b y W. W. Sawyer 3 An Introduction to Inequalities by E. F . Beckenbuch and R . B e Z l m 4 Geometric Inequalities by N . D. Kaavinoff 5 The Contest Problem Book I Annual 'High School Mathematics Examinations 1950-1960. Compiled and with solutions b y Churh T . W n d 6 The Lore of Large Numbers, b y P. 1. Duuis 7 Uses of Infinity b y Leo Zippin 8 Geometric Transformations I b y I . M . Y u g h , translated b y A. Shields 9 Continued Fractions b y Curl D. OMS

10 Graphs and Their Uses b y Oystein Ore 11 Hungarian Problem Books I and 11, Based on the EGtvaS 121 Competitions 1894-1905 and 1906-1928, translated b y E. Rapcrport 13. Episodes from the Early History of Mathematics by A. A h 14 Groups and Their Graphs by 1. Crossman und W. Mugnw 15 The Mathematics of Choice or How to Count Without Counting by loan Nim 16 From Pythagoras to Einstein b y K. 0. Friedrichs 17 The Contest Problem Book 11 Annual High School Mathematics Examinations 1961-1965. Compiled and with solutions b y Churh T. Saknd 18 First Concepts of Topology b y W. C. Chinn and N. E. Steend 19 Geometry Revisited by H . S . M . C&er und S . L. Creitzer u) Invitation to Number Theory by Oystein Ore 21 Geometric Transformations I1 b y 1. M . Y u g h , translated b y A. Shields 22 Elementary Cryptanalysis-A Mathematical Approach b y A. sink00 23 Ingenuity in Mathematics b y Ross Hmberger 24 Geometric Transformations 111 by 1. M . Y u g h , translated by A. Shtlritzer 25 The Contest Problem Book I11 Annual High School Mathematics Examinations 1966-1972. Compiled and with solutions by C. T . Saknd und J . M . Earl 26 Mathematical Methods in Science by George P d y u 27 International Mathematical Olympiads- 1959- 1977. Compiled and with soh tions b y S . L. Creitzer 28 The Mathematics of Games and Gambling by E d w d W. Puckel 29 The Contest Problem Book IV Annual High School Mathematics Examinations 1973-1982. Compiled and with solutions b y R . A. Artino, A. M . Caglione and N . Shell 30 The Role of Mathematics in Science b y M . M . Schiffr und L. Bowden 31 International Mathematical Olympiads 1978-1985 and forty supplementary problems. Compiled and with solutions b y Murray S. K W n 32 Riddles of the Sphinx ( y d Other Mathematical puzzle Tales) b y Martin Gardner

Other titles in prepmution.

Contents

Preface

3 5 5 7 8 13

Expansion of Rational Fractions Introduction Definitions and Notation Expansion of Rational Fractions Expansion of Rational Fractions (General Discussion) 1.5 Convergents and Their Properties 1.6 Differences of Convergents 1.7 Some Historical Comments

Chapter 1 1.1 1.2 1.8 1.4

19 27 28

Chapter 2 Diophantine Equations 2.1 Introduction 2.2 The Method Used Extensively by Euler 2.3 The Indeterminate Equation ax - by = +1 2.4 The General Solution of ax - by = c, (a, b) 2.5 The General Solution of ax by = c, (a, b) 2.6 The General Solution of Ax k By = f C 2.7 Sailors, Coconuts, and Monkeys

+

Chapter 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11

= =

31 31 32 36 1 42 1 44 46

Expansion of Irrational Numbers Introduction Preliminary Examples Convergents Additional Theorems on Convergents Some Notions of a Limit Infinite Continued Fractions Approximation Theorems Geometrical Interpretation of Continued Fractions Solution of the Equation z2 = ax 1 Fibonacci Numbers A Method for Calculating Logarithms

+

Vii

48

51 51 52 58 61 63 66 70 77

80 81 84

CONTENTS

Viii

Chapter 4 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9

Periodic Continued Fractions Introduction Purely Periodic Continued Fractions Quadratic Irrationals Reduced Quadratic Irrationals Converse of Theorem 4.1 Lagrange%Theorem The Continued Fraction for fi Pell’s Equation, x2 - Ny2 = +1 How to Obtain Other Solutions of Pell’s Equation

88 88 90 96 100 104 110 112 113 118

Chapter 5 5.1 5.2 5.3 5.4

Epilogue Introduct,ion Statement of the Problem Hurwitz’ Theorem Conclusion

123 123 123 124 129

Appendix I.

Proof That x2 Solutions

- 3y2 = -1

Has No Integral 131

Appendix 11. Some Miscellaneous Expansions

134

Solutions to Problems

140

References

159

Index

161

CONTINUED FRACTIONS

Preface

At first glance nothing seems simpler or less significant than writing a number, for example +,in the form 1+

1

1

It turns out, however, that fractions of this form, called “continued fractions”, provide much insight into many mathematical problems, particularly into the nature of numbers. Continued fractions were studied by the great mathematicians of the seventeenth and eighteenth centuries and are a subject of active investigation t d a y . Kearly all books on the theory of numbers include a chapter on continued fractions, but these accounts are condensed and rather difficult for the beginner. The plan in this book is to present an easygoing discussion of simple continued fractions that can be understood by anyone who has a minimum of mathematical training. Mathematicians often think of their subject as a creative art rather than as a science, and this attitude is reflected in the pages that follow. Chapter 1 shows how continued fractions might be discovered accidentally, and then, by means of examples, how rational fractions can be expanded into continued fractions. Gradually more general notation is introduced and preliminary theorems are stated and proved. In Chapter 2 these results are applied to the solution of linear Diophantine equations. This chapter should be easy to read; it is, if anything, more detailed than necessary. 3

4

PREFACE

Chapter 3 deals with the expansion of irrational numbers into infinite continued fractions, and includes an introductory discussion of the idea of limits. Here one sees how continued fractions can be used to give better and better rational approximations to irrational numbers. These and later results are closely connected with and supplement similar ideas developed in Niven’s book, Numbers: Rational and Irrational. The periodic properties of continued fractions are discussed in Chapter 4. The reader will find this chapter more challenging than the others, but the end results are rewarding. The main part of the chapter develops a proof of Lagrange’s theorem that the continued fraction expansion of every quadratic irrational is periodic after a certain stage; this fact is then used as the key to the solution of Pell’s equation. Chapter 5 is designed to give the reader a look into the future, and to suggest further study of the subject. Here the famous theorem of Hurwitz is discussed, and other theorems closely related to it are mentioned. It goes without saying that one should not “read” a mathematics book. It is better to get out pencil and paper and rewrite the book. A student of mathematics should wrestle with every step of a proof; if he does not understand it in the first round, he should plan to return to it later and tackle it once again until it is mastered. In addition he should test his grasp of the subject by working the problems at the end of the sections. These are mostly of an elementary nature, closely related to the text, and should not present any difficulties. Their answers appear at the end of the book. The first of the two appendices gives a proof that x2 - 3,y2 = - 1 has no solution in integers, and Appendix I1 is a collrction of miscellaneous expansions designed to show how the subjcct has developed; many of these expansions are difficult to obtain. Finally, there is a short list of refcrrnces. In the text “Crystal [2]”, for example, refers to item 2 listed in the references. I wish to express my thanks to the School Mathematics Study Group for including this book in the New Mathematical Library series, and to the Editorial Panel for suggestions which have improved the book. Particular thanks are due to Dr. Anneli Lax, not only for technical advice, so freely given, but also for her critical reading of the text. I am also grateful to my wife who typed the original manuscript, and to Mrs. Ruth Murray, who prepared the final typescript.

C. D. Olds Los Altos, California, 1961.

CHAPTERONE

Expansion of Rational Fractions

1.1 Introduction

Imagine that an algebra student attempts to solve the quadratic equation (1.1)

22-

32 - 1

=

0

as follows: He first divides through by x and writes the equation in the form

The unknown quantity x is still found on the right-hand side of this equation and hence can be replaced by its equal, namely 3 l/x. This gives x=3+-=3+--y 1 1

+

X

Repeating this replacement of obtains the expression

(1.2)

3+5

2 by

3

+ 1/x several more tjimeshe

1

x=3+ -3

+

1

3+

1

1 3 + - 7

3+; 6

CONTINUED FRACTIONS

6

Since x continues to appear on the right-hand side of this “multipledecked” fraction, he does not seem to be getting any closer to the solution of the equation (1.1). But let us look more closely at the right side of equation (1.2). We see that it contains a succession of fractions,

obtained by stopping a t consecutive stages. These numbers, when converted into fractions and then into decimals, give in turn the numbers

3,

10 - -- 3.333 3

* *

33- 3.3,

.,

10

109 - 3.30303 . . 33 * *

It then comes as a very pleasant surprise to discover that these numbers (or convergents as we shall call them later) give better and better approximations to the positive root of the given quadratic equation (1.1). The quadratic formula shows that this root is actually equal to 3+* X =

2

=

3.302775 *

* *

,

which, when rounded to 3.303, is in agreement to three decimal places with the last result above. These preliminary calculations suggest some interesting questions. First, if we calculate more and more canvergents (1.3),will we continue to get better and better approximations to x = 4(3 ? Second, suppose we consider the process used to get (1.2)as being continued indefinitely, so that we have in place of (1.2) the nonterminating expression

+ a)

(1 -4)

1

x=3+ 3+-

1

9

3 +*.

where the three dots stand for the words “and so on” and indicate that the successive fractions are continued without end. Then will the expression on the right of (1.4)actually be equal to 4(3 fl) ? This reminds us of an infinite decimal. For example, is what is meant when we say that the infinite decimal 0.333

+

RATIONAL FRACTIONS

7

equal to & ? These and many other questions will eventually be discussed and answered. Multipledecked fractions like (1.2) and (1.4) are called continued fractions. A study of these fractions and their many properties and applications forms one of the most intriguing chapters in mathematics. We must start with simpler things, however. The first of these is the introduction of basic definitions. 1.2 Definitions and Notation

An expression of the form

---

is called a continuedfractiora.In general, the numbers all a2,a3, , bl, b2, b3, - - - may be any real or complex numbers, and the number of terms may be finite or infinite. In this monograph, however, we shall restrict ou- discussion to 8imple continued fractions. These have the form (1.6)

a1

+

1 a2

7

+

1

9

1

+

a4

+

a.

where the first term al is usually a positive or negative integer (but could be zero), and where the terms a2,as, a4, * * are positive integers. In fact, until we come to Chapter 3, we shall further restrict the discussion to jinite simple continued fractions. These have the form

-

(1.7)

a1

+

1 a2

+

9

1 as

+

1 a4

+ -. '+

1 1 +a,

aR-l

8

CONTINUED FRACTIONS

with only a finite number of terms al,.az, a3, . . ,a,,. Such a fraction is called a terminating continued fraction. From now on, unless the contrary is stated, the words continued fraction will imply that we are dealing with a finite simple continued fraction. A much more convenient way of writing (1.7) is

+

where the signs after the first one are lowered to remind us of the “stepdown” process in forming a continued fraction. It is also convenient to denote the continued fraction (1.8) by the symbol [al, a2, * * . , a,], so that

The terms al, a2, * continued fraction.

*

, an

are called the partial quotients of the

1.3 Expansion of Rational Fractions

A rational number is a fraction of the form p/q where p and q are integers with q # 0. We shall prove in the next section that every rational fraction, or rational number, can be expressed as a finite simple continued fraction. For example, the continued fraction for $8 is -67= 2 + 29

1

3

+

1 1 1 =2+5+4+57

1

7

4+; or

67 - = [2,3,4,2]. 29

How did we get this result? First we divided 67 by 29 to obtain the quotient 2 and the remainder 9, so that (1.10)

-67= 2 + % =9 2 + - - 1 29 29 -

9

Note that on the right we have replaced & by the reciprocal of 4$.

RATIONAL FRACTIONS

9

Next we divided 29 by 9 to obtain 29 9

-=

(1.11)

3+-

2 9

=

1 3+-* 9

Finally, we divided 9 by 2 to obtain 9 1 -2 = 4 + 2 ’

(1.12)

at which stage the process terminates. ?ow su,stA,ute (1. 2) intc ( l . l l ) , and then substitute (1.11) into (1.10) to get

67 _ - 2 29

f

1

29 9

or (1.13)

67 - = [2,3,4,21 = [Ul,(22, 29

u3, url.

We should notice that in equation (1.10) the number 2 * 29 is the largest multiple of 29 that is less than 67, and consequently the remainder (in this case the number 9) is necessarily a number LO but definitely 0, be any rational fraction. We divide p by q to obtain

where a1 is the unique integer so chosen as to make the remainder r1 greater than or equal to 0 and less than q. As we saw in the worked examples, a1 can be negative, zero, or positive. If r1 = 0, the process terminates and the continued fraction expansion for P h is [ad. If rl # 0, we write (1.15)

and repeat the division process, dividing q by rl to obtain 9 r2 -=a2+-,

(1.16)

rl

0

5 r2 < r:.

Notice now that q/rl is a positive fraction, so a2 is the unique largest positive integer that makes the remainder 7-2 a number bet.ween 0 and rl. If r2 = 0, the process stops and we substitute q/rl = a2 from (1.16) into (1.15) to obtain P

- = a1 Q

+; 1

= [Ul, a21

as the continued fraction expansion for p / q .

R A T I O N A L FRACTIONS

If

r2

15

# 0, we write (1.16) in the form

Q 1 -=a2+--,

(1.17)

fl

0

r1 -

< r2 < r l ,

and repeat the division process using rl/r2. We observe that the calculations stop when we come to a remainder rn = 0. Is it possible never to arrive at an rn which is zero, so that the division process continues indefinitely? This is clearly impossible, for the remainders rl, r2, ra, . . form a decreasing sequence of non-negative integers Q > rl > r2 > T I > . . and unless we come eventually to a remainder r,, which is equal to zero, we shall be in the ridiculous position of having discovered an infinite number of distinct positive integers all less than a finite positive integer Q. Hence, by successive divisions wc obtain a sequence of equations: 3

0< (1.18)

...............

'n-2 - - an + 0 = an Tn-1


I,

if an =

,

CONTINUED FRACTIONS

38

in both cases the number of partial quotients is even. Using these continued fractions, one case or the other, we re-calculate p n - l / q n - l and p n / q n = a/b, and equation (2.13) is satisfied once more. Once a particular solution (20, yo) of equation (2.10) has been found, it is an easy matter to find the general solution. To this end, let (2,y) be any other solution of (2.10). Then and and a subtraction gives (2.14)

U(X

-

20) =

b(y

- yo).

This shows that b divides the left side of the equation. But b cannot divide a since a and b are relatively prime; hence b must divide 2 - 20, that is, z 20 is an integral multiple of b, and we may write (t an integer), x - zo = tb or 2 = 20 tb.

-

+

But if this is true, (2.14) shows that so that

It follows that any other solution (z,y) of a2 - b y = 1 has the form (2.15)

z = 20 y

= yo

+ tb

t

+ ta

=

0, + 1 , +2, +3,

Conversely, if (zo,yo) is any particular solution of az - b y = 1, and if we set up the equations (2.15) with t any integer whatever, then the values (2,y) will satisfy the given equation, because

ux

- by

+ tb) - b(yo + ta) = (a20 - by,) + tab - tab =

U(ZO

= azo

- by,

=

1.

We call the values of 5 and y given by equations (2.15) the general solution of the indeterminate equation ax - b y = 1.

D I O P H A N T I N E EQUATIONS

39

EXAMPLE 1. Find integral solutions of the indeterminate equation 2052 - 9 3 = ~ 1.

Here the integers 205 = 5 . 4 1 and 93 = 3 31 are relatively prime, so the equation has solutions.

SOLUTION. The continued fraction 2@ = [2,4, 1 , 8 , 2 ] has an odd number of partial quotients, but i t can be replaced by

the equivalent expansion with an even number of quotients. The convergenh are then computed.

I

1

2

3

4

5

6

2

4

1

8

1

1

2

9

11

97

108

205

1

4

5

44

49

93

2 1

9

11 5

97 44

108 49

205

4

!)3

Here n = 6, p,,-~ = p5 = 108 = yo, qn-1 = q 5 = 49 = 20, and hence, by (2.15), the general solution of the equation ax - by = 2052 - 93y = 1 is 2 = 20 tb = 49 93t t = 0, f l , f 2 , . ’ . , 2/ = ?/o t~ = 108 205t

+ +

+ +

As a check, let t = 1; then x = 142, y = 313 and 205(142) - 93(313) = 29110 - 29109 = 1 . As a general check we have 205(49 4- 93t)

- 93(108 + 205t)

=

1,

since the terms involving t cancel.

The method for solving the equation

ux - by

=

-1,

1, is quite similar to that used to solve (2.10). We convert u/b into a finite simple continued fraction with an odd number of convergents. In this case equation (2.12) becomes aqn-l

- bpn-l

=

( - l ) n = -1,

=

40

CONTINUED FRACTIONS

since n is odd. Comparing this equation with az

- by

=

-1,

we see that

YO = Pn-1 is a particular solution of the given equation, the general solution being, as before, XO =

z = 20 y =

YO

Qn-1,

+ tb

+ la

1 = 0, f l , +2, f 3 ,

... .

EXAMPLE 2. Find integral solutions of the equation 2052 - 93y

= -1.

SOLUTION. The numbers 205 and 93 are relatively prime, hence the given equation has integral solutions. The continued fraction expansion for 2 s is 205

- = [2, 4, 1,8, 21

93

and has an odd number of partial quotients, so (- l)n = (- 1)6 = required. To find the convergents we set up the table 2

~

-

1

0 2

ai

13 2 4

~ 4

as

5

1

8

2

pi

0

1

2

9

11

97

205

qi

1

0

1

4

5

44

‘33

2 1

9 4

11 5

97 44

203 93

Ci

-1

Our calculations show that cn-l = p,,-,/qn-., = p4/q4 = %$; hence a particular solution of the given equation is xo = 9 4 = 44 and yo = p4 = 97. The general solution, therefore, is

+ tb = 44 + 93t yo + t~ 97 + 205t

z = xo 2/

=

As a check, take t

t = 0, +1, +2,

=

=

205(-49)

-1;

... .

then (x,y) = (-49, -lo@, and

- 93(-108)

=

-10045

+ 10044

=

-1.

DIOPHANTINE EQUATIONS

41

It is interesting to notice that once we have calculated the particular solution (20, yo) = (qn-l, pne1) of the equation

ax

- by = 1,

we can immediately obtain a particular solution, call it the equation

- by

(2.16)

=

(XI,

yl), of

-1.

The particular solution of (2.16) will be

- xo = b - qn-l, = a - yo = a - P,-~, =

21

(2.17)

Yi

b

for then ax1

- by1 = a(b - qn-1) - b(a - pn-1) = ab - ab - (aqn-1 - bp,,-,) = (-1)(aqn-1 - bpn-1) =

(-l)(+l)

=

-1,

since from (2.13) we know that aqn-1 - bpn-1 = 1. The general solution of the equation ax - by = - 1 will then be (2.18)

x

+ tb

= 21

y = YI

+ ta

... ,

t = 0, + 1 , 5 2 , +3,

and this can be checked by a direct substitution. EXAMPLE 3. Show that we can solve Example 2 if we have already solved Example 1. That is, solve the equation 205%- 93y = -1, knowing that (q, go) = (49, 108) is a particular solution of 2052 - 93y = 4-1.

SOLUTION. Using equations (2.17) we find that

- 49 = 44, 91 = u - yo = 205 - 108 = 97, is a particular solution of 205%- 93y = -1. Hence the general solution, 21

=

b

- XO

=

93

according to (2.18), is 2 =

(2.19)

g =

+ 93t 97 + 205t 44

t

=

0, Stl, +2,

which agrees with the solution given for Example 2.

e

.

1

,

42

CONTINUED FRACTIONS

There is still another way to solve Example 2, provided we know a particular solution of Example 1. This is illustrated in the following example.

EXAMPLE 4. Give a third solution of the equation 2052 - 93y = -1. SOLUTION. Since (50,yo) = (49, 108) is a particular solution of the equation 2052 - 93y = +1, we know that 205(49) - 93(108)

=

4-1.

If we multiply through by -1 we see that 205(-49)

- 93(-108)

=

-1;

hence (a,yl) = (-49, - 108) is a particular solutionof 2052 - 93y = - 1, and the general solution becomes

+ 93t ta = -108 + 205t

z = Z 1 + tb

(2.20)

y =~

=

-49

t = 0,

51, 52, . . * .

1 4 -

Notice that equations (2.19) and (2.20) reproduce the same values of z and but not for the same values of t. For example, t = 2 in (2.19) gives (2, y) = (230,507), the same values obtained from (2.20) for t = 3. Problem Set 6 1. Find the general integral solutions of the following equations. Check each answer.

(a) 132 - 17y = 1 (b) 132 - 17y = -1

-

(c) 652 5 6 = ~ 1 (d) 6 5 ~ 56y = -1

2.4 The General Solution of ax

- by = c,

(e) 562

- 65y = 1

(a, b) = 1

Once we have learned to solve the indeterminate equation

(2.21)

OX

- by = 1,

where a and b are two relatively prime positive integers, it is a simple matter to solve the equation

(2.22)

- by

=

C,

where c is any integer. For, suppose that solution of (2.21) ; then

- by0 = 1,

(ZO,yo)

is any particular

43

D I O P H A N T I N E EQUATIONS

and multiplying both sides by c, we obtain

a(cz0)

- b(cy0)

=

c,

so that (cro, cyo) is a particular solution of (2.22). Thus the general solution of equation (2.22) will be z=C2!0+bt

(2.23)

y

=

CYO

1 = 0, +1, +2,

+

- - *

.

This can easily be verified by a direct substitution into (2.22).

EXAMPLE 1. Solve the equation

- 93y = 5.

2052 SOLUTION.From

Example

1, Section 2.3, we

know that

(xo, yo) = (49,108)is a particular solution of the equation 2052 - 93y = 1,

that is, 205(49)

- 93(108) = 1.

Multiplying both sides by 5 we get 205(5 * 49)

- 93(5 - 108) = 5,

so that (5z0,5y0)= (245,540) is a particular solution of the given equation. The general solution, according to (2.23),will be x = 245

+ 93t

t = 0, f1, f2, ...

y=540+205t

As a check, take

.

t = 1; then (2,y) = (338,745)and

205(338) - 93(745) = 69290 - 69285 = 5.

EXAMPLE 2. Solve the equation 2052

- 931/= -5.

SOLUTION. In Example 1 of this section we recalled that 205(49)

- 93(108) = 1.

Multiplying through by -5 we get 205(-5 * 49) - 93(-5 or

205(-245)

so that

(20,

*

108) = -5,

- 93(-540)

YO) = (-245, -540)

=

-5,

is a particular solution of the given

CONTINUED FRACTIONS

44

equation. The general solution, according to equation (2.23),is then x = -245

y

=

-540

To check this, take t 205(-59)

=

+ 93t + 205t

t = 0,+1, f2, . * .

.

2, then (z,y) = (-59, -130), and

- 93(-130)

=

-12095

+ 12090 = -5.

Problem Set 7 1. Use particular solutions obtained from the problems at the end of Section 2.3 to obtain the general integral solutions of the following

equations. Check each answer. (a) 132 - 17y = 5

(b) 652 - 56y

2.6 The General Solution of ax

=7

(c) 562 - 65y = -3

+ hg = c,

(a, b) = 1

The discussion of this equation is similar, except for mme minor changes, to that of the equation ax - by = c. Still assuming that a and b are positive integers, we first find a particular solution of the equation (a$) = 1. ax by = 1,

+

To do this, expand u / b as a simple continued fraction with an even number of partial quotients. From the table of convergents read off pn-1 and qn-l. Then aqn-1

- bpn-1

=

1,

as before. The trick now is to write the given equation ax in the form OX

+ by

c*1

=

= c(aqn-1

Rearrange terms to obtain (2.24)

a(cqn-1

- X) = b(Y

+

+ by

=

c

- bPn-1). Cpn-1)-

This shows that b divides the left side of theequation; but (a,b) = 1, so b cannot divide a. Therefore b divides Cqn-1 - x, so that there is an integer t such that (2.25)

cqn-1

- x = tb,

or (2.26)

x

= cqn-1

- tb

4s

DIOPHANTINE EQUATION8

Substitute (2.25) into (2.24) to get

a(tb) = b(y

+

CPn-l),

and solve for y to obtain

-

y = at

(2.27)

cpn-1.

Conversely, for any integer t, a direct substitution of (2.26) and (2.27) into ux by gives

+ uz + by

the equation ux of the equation ux

SO

(2.28)

x

=

=

acqn-1

=

c(aqn-1

- tb) + b(at - C p n - 1 ) - tab + tab - b c p n - 1 - bpn-1) c 1 = C, *

+ by = c is satisfied. Thus the general solution + by = c is - tb

cqn-1

y = at

a(cqn-1

-

t

=

0, +1, +2, +3, . . * .

Cpn-1

EXAMPLE 1. Solve the indeterminate equation 132

SOLUTION. We find that equation

+ 17y

(20,yo)

=

300.

= (4,3) is a particular solution of the

132 - 17y = 1,

or that 13(4) - 17(3) = 1, and so the given equation may be written in the form 132 17y = 300(13 * 4 17 * 3), or 132 - 13(4 * 300) = - 1 7 ~- 17(3 -300).

+

-

This shows that 13(2 - 1200) = -17(y

(2.29)

so that 17 divides z - 1200, or

x Replacing z

- 1200 by

=

1200

+ goo),

+ 17t.

17t in (2.29) gives I/ =

-13t

- 900.

Hence the general solution of the given equation is

x

=

1200

2/ = -13t

+ 17t

- 900

t = 0, f l , +2, f3,

* * * .

CONTINUED FRACTIONS

46

EXAMPLE 2. Solve the indeterminate equation 132

+ 1 7 ~ -300. =

SOLUTION.The second equation in the solution of Example 1 now

becomes

+

13% 1 7 = ~ -300(13

*

4 - 17 * 3),

and equation (2.29) is replaced by

+ - 1 7 ( ~ - 900). It follows that 17 divides z + 1200, or x = -1200 + 17t, and replacing z + 1200 by 17t gives (2.29a)

1 3 ( ~ 1200)

p

=

=

900 - 13t.

Hence the general solution of the given equation is z

=

-1200

2/ = 900

+ 171

- 13t

t

= 0,

+1, +2, +3, ’ . .

2.6 The General Solution of Ax

.

+ By = + C

By multiplying through by -1, any equation of the form

+Ax

* By

=

c

can be reduced to one or the other of the forms

+

A X - By = fC, A X By = +C, where A and B are positive integers. For example, of the four equations (2.30)

32

+ 7y

=

10, 3x - 7y

=

10, -3x

- 7y

=

10, -&

+ 7y

=

10,

the first two are already in the required form, and the second two can be replaced, respectively, by 32

+ 7y

=

-10

and

32 - 7y = -10.

Not all equations of the form (2.30) have solutions. To see this, let d be the greatest common divisor of A and B. Then, if d does not diiiide C, neither of the equations (2.30) can be solved in

D I O P H A N T I N E EQUATIONS

47

integers x , y, for the left side of each would be divisible by d while the right side is not. On the other hand, if d does divide C, then we can divide both sides of the equations (2.30) by d , reducing them respectively to equations of the form we have just discussed, namely ax

(2.31)

+ by

= c,

ax

- by

= c,

where a and b are relatively prime, and of which we know the solutions. Conversely, any solution of equations (2.31) will automatically give solutions of equations (2.30). EXAMPLE 1. Solve the equation 4102 - 1 8 6 ~= 10.

-

-

SOLUTION. Since 410 = 2 5 * 41, 186 = 2 3 * 31, the g.c.d. of 410 and 186 is d = 2. Since d = 2 divides 10, the equation can be solved. Divide the given equation by 2 to obtain 2052 - 93y

5,

where now 205 and 93 are relatively prime. This is the equation solved in Example 1 of Section 2.4. The general solution of 2052 - 93y = 5 found there was

+ 93t, y = 540 + 205t,

x = 245

and substituting it into 4102 - 186y we find that 410(245

+ 93.9 - 186(540 + 205t)

= 410

.245 - 186 * 540 = 10.

The main results obtained from our study of the linear Diophantine equation can be summarized as follows: Summary. Any equation of the form Ax f By = f C has integral solutions x , y only if the greatest common divisor of A and B divides C. In this case, divide A , B, and C by d = ( A , B), reducing the given equation to either the form

(i) or the form

(3

ax -I-by

= C,

- by

= C,

where in both equations a and b are relatively prime positive integers, and where c is a positive or negative integer. The next step is to expand a/b as a simple continued fraction with an even number

CONTINUED FRACTIONS

48

n of partial quotients, and from the table of convergents read off pn-l and Q,,-~. Then q n - l - bpn-1 = 1, and the general solution of (i) is

Likewise the general solution of (ii) is

x (iv)

=

y =

cqn-1 cpn-1

+ tb

t

+ ta

=

0, i-1, +2, . . . .

The solutions (iii) and (iv) represent, respectively, for the cases (i) and (ii) the general solution of Ax i- By = +G. Problem Set 8 1. Two of these six equations do not have integral solutions. Find the general solution in integers of the others.

+ +

(d) 342 - 49y (e) 342 49y

(a) 1832 174y = 9 (b) 1832 - 1 7 4 ~= 9 (c) 772 63y = 40

(f)

=

5

+ =5 562 + 20y = 11

2. Express #as the sum of two fractions whose denominatorsare 7 and 11. 68 x Hint: Find integers x and y such that - = - 1* 77 7 11

+

3. The sum of two positive integers a and b is 100. If a is divided by 7 the remainder is 5, and if b is divided by 9 the remainder is also 5. Find a and b. Hint: Let a = 72 5, b = 9y 5 and use the fact that

a

+ b = 100.

+

+

4. Find positive integral solutions

(2,y)

of 132

+ 17y = 300.

2.7 Sailors, Coconuts, and Monkeys

The following problem is of considerable age and, in one form or another, continues to appear from time to time. Five sailors were cast away on an island. To provide food, they collected all the coconuts they could find. During the night one of the sailors awoke and decided to take his share of the coconuts. He divided the nuts into five equal piles and discovered that one nut was left over, so he threw this extra one to the monkeys. He then hid his share and went back to sleep. A little later a second sailor awoke and had the same idea as the first. He divided the remainder

DIOPH A N T I N E E Q U A T I O N S

49

of the nuts into five equal piles, discovered also that one was left over, and threw it to the monkeys. Then he hid his share. In their turn the other three sailors did the same thing, each throwing a coconut to the monkeys. The next morning the sailors, all looking as innocent as possible, divided the remaining nuts into five equal piles, m nuts being left over this time. The probkm is to Jind the smallest number of nuts an the original pile. In order to solve this problem, let x be the original number of coconuts. The first sailor took +(z - 1) coconuts and left +(x - 1). Similarly the second sailor took

I

4x259

![!(x-1)-1 =5 5 coconuts and left four times this number, or 162 - 36 25 Similarly, we find that the third, fourth, and fifth sailors left, respectively,

- 244 ’ 125

642

2562 - 1476 625 ’

10242 - 8404 3125

nuts. Now the number of nuts in the last pile must be a multiple of 5 since it was divided evenly into five piles with no nuts left over. Hence 10242 - 8404 =5~, 3125 where y is some integer. Multiplying both sides by 3125 we obtain the indeterminate equation

(2.32) 10242 - 15625~= 8404. Factoring into primes we find 1024 = 21° and 15625 = 56;hence these numbers are relatively prime and the equation (2.32) has integral solutions. We first seek a particular solution (XI,y1) of the equation (2.33) 10242 - 15625~= 1. To this end, the convergents of the continued fraction

50

CONTINUED FRACTIONS

are calculated : i

- 1 0

ai

ps

4

5

6

7

8

0 1 5 3 1

6

2

1

3

27

58

85

313

1

0 1

2

0

1

3

3

4

9

10

2

1

711

1024

- - _ ~-~

The convergent CP yields the particular solution z1 = qg = 10849, = pp = 711 of equation (2.33). Hence 20 = 8 4 0 4 ~=~91174996, yo = 8 4 0 4 ~ 1= 5975244 will be a particular solution of equation (2.32). The general solution is yl

(2.34)

+ 15625t 5975244 + 1024t

z = 91174996 g

=

1=

0, +1, +2, . . . .

Since both x and y must be positive, we search for the value of t which gives the smallest positive value of z and which a t the same time makes y positive. From (2.34) we find that t must be an integer satisfying the two inequalities t>t

91174996 15625

=

5975244 > -= 1024

,

-5835.2

-5835.1 . . . .

Hence the required value is t = -583.5. Introducing this value of t into equations (2.34), we finally obtain z

=

91174996 - 91171875

=

y

=

5975244 - 5975040

204,

=

3121,

which means that the original number of coconuts was 3121 and each sailor received 204 in the final distribution. For an interesting discussion of this and related problems, see the article entitled “Mathematical Games” by Martin Gardner in Scientific American, April, 1958. One should also keep in mind the excellent collection of references, Recreational Mathematics, A Guide to Me Literature, by William L. Schaaf, published by the National Council of Teachers of Mathematics.

CHAPTER THREE

Expansion of Irrational Numbers

3.1 Introduction

So far our discussion has been limited to the expansion of rational numbers. We proved that a rational number can be expanded into a finite simple continued fraction, and, conversely, every finite simple continued fraction represents a rational number. This chapter will deal with the simple continued fraction expansion of irrational numbers, and we shall see that these fractions do not terminate but go on forever. An irrational number is one which cannot be represented as the ratio of two integers. The numbers

are all irrational. Any number of the form

where P , D, Q are integers, and where D is a positive integer not a perfect square, is irrational. A number of this form is called a quadratic irrational or quadratic mrd since it is the root of the quadratic equation Q2z2- 2PQx

+ (P2- D ) = 0.

Our discussion will be limited to the expansion of quadratic irrationals. 51

52

CONTINUED FRACTIONS

There are irrational numbers which are not quadratic surds. The irrational number ?r = 3.14159 . . . is one example. The irrational number 2/2 is the solution of the algebraic equation x2 - 2 = 0, and is therefore called an “algebraic number”. An algebraic number is a number x which satisfies an algebraic equation, i.e., an equation of the form

aoxn

+ alxn-l + . . . + a,

=

0,

where ao, al, . . . are integers, not all zero. A number which is not algebraic is called a transcendental number. It can be proved that r is transcendental, but this not easy to d0.i The number e is also transcendental. It is quite difficult to expand transcendental numbers into continued fractions; using decimal approximations to these numbers, such as ?r = 3.14159 . . . and e = 2.71828 . . . , we can calculate a few of the first terms of their continued fraction expansions, but the methods of obtaining the expansions of ?r and e given in Appendix I1 are beyond the scope of this monogrzph. Those who wish to learn about the two classes of irrational numbers, namely algebraic irrational numbers and transcendental numbers, and to study the deeper properties of each should read the first monograph in the NML (New Mathematical Library) series: Numbers: Rational and Irrational, by Ivan Niven. 3.2 Preliminary Examples

The procedure for expanding an irrational number is fundamentally the same as that used for rational numbers. Let x be the given irrational number. Calculate al, the greatest integer less than x, and express x in the form

where the number

== 1

x2

> 1

is irrational; for, if an integer is subtracted from an irrational number, the result and the reciprocal of the result are irrational. To continue, calculate a2, the largest integer less than 2 2 , and t See I. Niven [8].

53

IRRATIONAL NUMBERS

express

52

in the form

where, again, the number x3

=

-> 1 2 2 - a2

is irrational. This calculation may be repeated indefinitely, producing in succession the equations 1 x=a1+-,

22

> 1,

x3

> 1,

a2

2 1,

24

> 1,

a3

1 1,

22

x2 = a2

+-1 , 23

23

=

a3

+-1 , 24

.............

........

......

...............

........

.....

1

where ax, a2, . . . . a,, . . . are all integers and where the numbers x, x 2 , 2 3 , 2 4 , . . . are all irrational. This process cannot terminate, for the only way this could happen would be for some integer a,, to be equal to x,,, which is impossible since each successive xi is irrational. Substituting x2 from the second equation in (3.1) into the first equation, then 2 3 from the third into this result, and so on, produces the required infinite simple continued fract,ion

z

= a1+-

1

= a

1

+

22

a2

1

y

+23

1

= Ul+ a2

+7 +a3

or

- ... 9

1

XI

64

CONTINUED FRACTIONS

where the three dots indicate t h a t the process is continued indefinitely. Before discussing some of the more “theoretical” aspects of inJinite simple continued fractions, a n example or two should be worked to make sure the expansion procedure is understood.

EXAMPLE 1. Expand

dz into an infinite simple continued fraction.

SOLUTION. The largest integer

< lh = 1.414 . . . is

4 2 = a l + w1 = Solving this equation for

Consequently,

50,

1

a1 = 1, so

+-.1 $2

we get

+ -X21 = 1 + -d 2 1+ 1 < x z = l.

0,

Hence x

=

1

1 +----= 1+ 1

2+Y

1 2+

2 7

+

6

Simplifying the right-hand side, we obtain 2 =

23

+3 6

. 1 6

- 2 6 - 25 + 6

1 6 + 2 d S 16-21/53

which is the original value of

2.

22

'

we find

68

CONTINUED FRACTIONS

3.3 Convergents

The convergents to the infinite continued fraction

are calculated in exactly the same way as before. The convergent cn = p n / q n is calculated by the same formulas p n = anPn-1 =

Qu

anqn-1

+ +

pn-2,

qn-2

for all n 2 1, where, as before, we define p-1 = 0, po = 1, q-l = 1, and q o = 0. The computational scheme is the same. EXAMPLE 1. The infinite continued fraction for out as follows: T

= [3, 7, 15, 1, 292, 1, 1,

T

= 3.14159

. starts

...I.

Calculate the first five convergents. These convergents give successively better approximations to T . SOLUTION. The table of convergents is as follows: 0

i I - 1 ai -

I

2

1

3

7

1

3

4

5

5

1

292

Pi

0

1

3

22

333

355

103993

qi

1

0

1

7

106

113

33102

3 1

22 7

333 106

365 113

103983 33102

~

Ci

In this connection it is interesting to note that the earliest approximation to u is to be found in the tlhind Papyrus preserved in the British Museum and dated about 1700 B.C. Translated into our decimal notation, the value of u stated there is 3.1604. The approximation u = 3, less accurate than the above Egyptian value, was used by the Babylonians. Archimedes (c. 225 B.c.) stated that the ratio of the circumference of any circle to its diameter is less than 3: = = 3.11285 . . , but greater than 3 8 = 3.14084 . . . ; this is quite a remarkable result considering

IRRATIONAL NUMBERS

59

the very limited means at his disposal. The approximation

”’ 113

- - - 3.141592 . . . is correct to six decimal places. More information on the use of continued fractions to give rational approximations to irrational numbers will be taken up in Chapter 5.

Problem Set 9 1. Verify the following expansions and calculate the first five convergents: 24 - fi = 11, 5,231 (a) d6 = [2,2,4,2,4, . . . ] = [2,2,4] (d) 17

(c)

fi= [6, 1, 1, 3, 1, 5,1, 3, 1, 1, 121

2. -4s in the second half of Example 2,Section 3.2,verify that the following continued fractions represent the irrational numbers written on the right. (a) [2,2,41 =

dti

(b) [5,1, I, 1, 101 =

fi

3. Discussion Problem. The following is one of the classical straightedge and compass problems. Construct, using only a straightedge and compass, a square equal in area to a circle of radius 1. A circle of radius 1 has an area L4 = ur? = A, so a square with the same area would have a side equal to 2/;;. Wcre it possible to construct the length a we could then construct 4;by the following means: Let AB = a, BC = 1 and draw a semicircle with center at 0 and passing through A and C; see Figure 2. I h w RII perpendicular to AC. Then x = BD = &. T o prove this use the similar triangles ABD and CBD.

Figure 2

CONTINUED FRACTIONS

60

I t can be proved that a length equal to B cannot be construcled with straightedge and compass. However, there are many interesting approximate constructions. For example, Jakob de Gelder in 1849 gave the following construction using the convergent 9% = 3.141592 . . . discussed a t the end of Section 3.3. +S’ince 355 - -- 3 + - - - - - 1 42 113 82

+

the approximation t o B can easily be constructed as follows: Let 0 be the center of a circle with radius OB = 1 . Let .1B be a diameter perpendicular t o OB. Let OD = & and -1F = &; see Figure 3. Draw FG parallel t o EO and FH parallel t o DG. Then prove that A H = 42/(72 89, and i t only remains t o construct a line equal in length t o 3 A H .

+ +

A H G

B

0 Figure 3

4. Show that +( 2/5 vergents are

+ 1 ) = [1 , 1 , 1

1 . . .I, and also verify that the con-

1 2. . l 3- , 5 - 1 8 1 3 1 1 2 3 5 8

- 1

- 1

1

...

,

both numerators and denominators being formed from the sequence of Fibonacci numbers 1 , 1, 2, 3, 5, 8, 13, 21, 34, 55, ’ . . . Each of these numbers is the sum of the preceding two. A discussion of these interesting numbers will be given in Section 3.10.

5. The Fibonacci numbers F , = 1, F 1 = 1, F S = 2, F a = 3, . . . can be reproduced by substituting n = 1, 2, 3, . . . in the general formula

Verify this by substituting n = 1, 2, 3, 4 into this formula.

6. Imagine that each branch of a certain tree has the following pattern of growth. I t produces no new branches during its first year of growth. During the second, it puts forth one branch, then “rests” for a year, then branches ?gain, and so on. Sketch such a tree after a five-year growing

IRRATIONAL NUMBERS

61

period and show that, if we regard the trunk and its extensions as branches, then in the first year of the tree's growth it has one branch (the trunk), in the second year two branches, and in general the number of branches will reproduce the Fibonacci numbers 1, 2, 3, 5, 8, . . .

.

7. W y t h o f s game (invented in 1907 by W. A. Wythoff). Alternately two players A and B remove counters from two heaps according to the following rules: A t his turn a player may take any number of counters from the first or from the second heap. If he wishes to take counters from both heaps, then he must remove an equal number of counters from each. The player who takes the last counter from the table wins. In order for player -4to win he should, after his move, leave one of the following safe combinations (safe for -4): (1, 21, (3, 51, (4, 71, (6, 101, (8, 131, (9, 151, (11,

w, (12, 201,

.. . *

Then no matter what B does in the next move he will leave an unsafe combination (unsafe for B), and A can always convert this back into a safe combination (safe for A). So unless A makes a mistake, he will win the game. I t can be proved that the nth pair of numbers forming a safe combination is given by

(bd,bw),

+

n

= 1, 2, 3,

-

a

-

,

where T = &( 4; 1) and where { x 1 stands for the greatest integer less than or equal to z. Verify this statement for n = 1,2,3. For more details about this game and related subjects see H. S.M.Coxeter: The Golden Section, Phyllotaxis, and Wythofs Game, Scripta Mathematica, vol. 19 (1953), pp. 135-143.

8. Using only a straightedge and compass, construct a point G on a line segment A B such that (AG) = d G B ) , where T = l ( 1

+ a).

9. Use the results of Problem 8 to show how to construct a regular pentagon

using only a straightedge and compass. 3.4 Additional Theorems on Convergents

The numerators p n and denominators qn of the convergenta p n / q n of the infinite simple continued fraction

Cn =

[a19

. . . , an, . . -1

satisfy the fundamental recurrence relation

- pn-lqn = n 2 0, proved in Theorem 1.4, the proof given there being independent of (3.2)

pnqn-1

02

CONTINUED FRACTIONS

whether the continued fraction was finite or infinite. From this equation, upon dividing both sides by qnqn-1, we find that n 2 2.

(3.3)

Since

Cn

=

pn/qn,

equation (3.3) can be stated as n 12.

Similarly we can prove

THEOREM 3.2.

- Cn-2

Cn

=

an(-

n 2 3.

QnQn-2

PROOF.Clearly Cn

-

PnQn-2 - p n 4 n . pn Pn-2 -=

=

qn

Qnqn-2

qn-2

In the numerator on the right, substitute pn

+

= anpn-i

Pn-2,

qn

=

anqn-i

+

qn-21

obtaining pnqn-2

- pn-pqn

=

(anpn-i+

= an(pn-iqn--2

pn-2)qn-t

- pn-z(anqn-1

+

qn-2)

- pn-~qn-1)

-

= an( 1)"-',

where the last equality follows from equation (3.2) with n replaced by n - 1. This proves Theorem 3.2. These theorems give us important information as to how the convergents cn change as n increases. If we set n = 2 and then n = 3 in Theorem 3.1, and recall that the q n ' s are positive, we see that

respectively. These inequalities show that. (3-4)

c1

< c2

and that

c3

< c2.

63

IRRATIONAL NUMBERS

On the other hand, setting n = 3 in Theorem 3.2 shows that

since q3,q1, a3 are all positive numbers. Hence combining this result with those in (3.4) proves that c1

c1

< CS,

and

< CQ < c2.

Similarly, using n = 3, then n = 4 in Theorem 3.1, followed by n = 4 in Theorem 3.2, we see that c3

< c4 < c2.

Proceeding step by step in this fashion, we obtain themequalities

< cs < c4, cb < c8 < c4j

c3

Combining these inequalities we obtain the fundamental result ~1

< ~3 < cs
, L, where 1~ is a L=

C I < C ~ < . * . 0,

P E R I O D I C C O N T I N U E D FRACTIONS

101

and

-b-dG=-G

a' =

(4.21)

-P - f i

Q

2a

where

P

(4.22)

=

D

-b,

=

b2 - 4ac,

Q

=

2a

>0

are integers. If we assume that D > 0 is not a perfect square, then the roots a and a' are quadratic surds of the form A f B C D , where A = P / Q and B = l / Q are rational. Under these assumptions the quadratic irrational a given by (4.20) is said to be reduced if a is greater than 1 and if its conjugate a', given by (4.21), lies between - 1 and 0. It is important in what follows to find out more about the form and properties of reduced quadratic irrationals. Throughout the rest of this chapter, P , Q, D will be as defined by (4.22). Suppose, then, that the value of a given by (4.20) is a reduced quadratic irrational, i.e., that a=

P + f i

Q

The conditions a

> 1,

>1

and and a'

-1

> -1

P + 6 & P - 6 I

Q

and since Q

> 0,

Q

we conclude that P

- 1 shows that P - O > - Q or , G - P < Q . Finally we observe that

+

P2 - D

=

(-b)2

- (b2 - 4ac) = 4ac = 2c &. *

We have shown that if a is a reduced quadratic irrational of the form (4.20),then the integers P , Q, D satisfy the conditions (4.23) 0

< P < fi, and fi- P < Q < fi+ P < 2 fi.

C O N T I N U E D FRACTIONS

102

The reason for introducing the notion of reduced quadratic surds has not been explained. This idea, however, is a well-established concept in the theory of numbers, and is intimately related to the theory of reduced quadratic forms. For our purpose, the importance of the idea depends upon the fact that for any given D there is only a jinite number of reduced quadratic surds of the form (4.20). This follows directly from the inequalities (4.23); for, once D is fixed, there is only a finite number of positive integers P and Q such that P 0, P = -b, Q = 2a, and D = b2 - 4ac > 0 not a perfect square; see (4.22).Write a in the form a = al l/al, where a1 is the greatest integer less than a. Clearly a = a1 l/al satisfies the

+ +

P E R I O D I C C O N T I N U E D FRACTIONS

103

quadratic equation

(

a a1+-

or (ad

3

+b

(

a1+-

n'3

+c=o,

+ ba1 + c,a; + (2aa1+ b)a1 + a = 0.

Solving for the positive root a1, we obtain

where

PI and

=2

Q1 = - 2 ( ~ + 4 b

+

~ ~ b,1

+ c),

~ 1

D1 = (2aa1+ b ) 2 - 4a(aa; + ba1 + c) = b 2 - 4ac = D.

These expressions give us the explicit form of al. It is also clear that PI, 91,and D1 = D are integers, and a1 =

P1+

6

&I

has the same irrational part 16as a has. It will now be shown that a1 is a reduced quadratic surd. To this end, we recall that at is the greatest integer less than a ; therefore 0 < l/al < 1, so a1 > 1, as required, and it only remains to prove that -1 < a; < 0. Solving the equation a = a1 (l/al) for a1 and taking the conjugate of the result (see page 99), we obtain

+

a; =

(--)

1

'

=

1 a ' a1

Therefore

since a1 2 I and, by hypotheses, -1 < a' < 0. If follows that 0 < -a; < 1, or - 1 < a; < 0. Thus al is a reduced quadratric surd, and hence the inequalities (4.23) are automatically inherited by P1, Q1,and D1= D. Finally, we prove that if a is a reduced quadratic irrational, then its associate /3 = - l/a' is also a reduced quadratic irrational; for,

CONTINUED FRACTIONS

104

the inequalities a > 1, -1 < a’ < 0 imply that fi that p’ = -l/a lies between -1 and 0.

> 1,

and

Problem Set 16

+

1. Show that, if a = 9(5 6 7 ) is expressed in the form a = al ( l / a , ) ,where al is the largest integer less than a, then al is a reduced quadratic irrational.

+

2. Show that the conditions (4.23) are necessary and sufficient conditions for a [defined by equation (4.20)] to be a reduced quadratic irrational, In other words, prove that conditions (4.23) imply that 1 < a and - l . < a‘ < 0. 3. Determine all the reduced quadratic irrationals of the form (P 6 3 > / Q .

+

4.6 Converse of Theorem 41

We are now ready to prove THEOREM 4.2 (CONVERSE OF THEOREM 4.1). I f a is a reduced quadratic irrational, so that a > 1 i s the root of a quadratic equation with integral coejkients whose conjugate root a’ lies between - 1 and 0, then the continued fraction for a i s purely periodic. PROOF. We first investigate the actual expansion of a into a continued fraction; then we show that this expansion is necessarily purely periodic. The first step is to express the reduced quadratic irrational a in the form (4.24)

a=

P + 6

Q

1

=a~+-p a1

where al is the largest integer less than a, and where

is again a reduced quadratic irrational associated with D . This we established in Section 4.4.

P E R I O D I C C O N T I N U E D FRACTIONS

105

Step (4.24) is the first step in converting a! into a continued fraction. Repeating the process on all we obtain ffl

=

Pl+d5

1 = a 2 + - 1

Qi

ff2

where a2 is the largest integer less than al, and ff2

=

P 2

+ fi> 1 Q2

is a reduced quadratic irrational. At this stage we have ff

= a1

+1

- 1

ff1

1 a 1 = C 4 2 + - 1 ff2

where a, crl,

a 2

are reduced, and

Continuing the process, we generate step-by-step a string of equations 1 ao=a1+-1

ff1

ff1

=

a 2

+ -1

1

a 2

. . . . . . . .,.

. . . ... . . . . . . . 9 where a. = a, a1, cy2, . . . are all reduced quadratic irrationals associated with D, and where

Since a is irrational this process never comes to an end, and hence we seemingly are generating an infinite number of reduced surds

106

CONTINUED FRACTIONS

(YO, al, . . . , an, . . . , all associated with D . But we proved in Section 4.4 that there can only be a finite number of reduced G'S associated with a given D ; therefore, we must arrive eventually at a reduced surd which has occurred before. Suppose, then, that in the sequence

(4.25)

ff0, f f l ,

.

' ' 7

ffk-1, f f k ,

'

..

ffZ-1, ffZ,

' * *

all the complete quotients cyo, CYI, - . . , (YZ-1 are different, and that a1 is the first one whose value has occurred before, so that (YZ = f f k ,

OSk 0 is a given integer, and where x and y are unknown integers whose values we are seeking. We assume that N is not a

CONTINUED FRACTIONS

114

perfect square; otherwise the equation is of little interest, since the difference of two perfect squares is never equal to 1 except in the special cases (3- 1)2- 02. (Why?)

The continued fraction expansion for C N supplies all the equipment we need to solve Pell’s equation x 2 - Ng2 = 1, or x 2 - Ny2 = - 1, provided solutions exist. We know that 1

1

(4.37)

1

+a,+%+&+

...

+ +

1

1 an

-

=a1+--+

1

...

fi=a,+az+

_

...

1

I

_

an+l

where (4.38)

an+i

2ai

=

1

3.a2

+

...

+ al.

=N
qn + al)pn

pn-1

qn-1

. ’

then, multiplying both sides by the denominator, we get

d N ( f i + al>q, + qn-1 d E

=

(fi + al>pn+ pn-11

which is equivalent to Nqn

+

+

( u I ~ * qn-1)

dZ = (alp, +

+ pn dZ* a + b C N c + d dN, pn-1)

Now this is an equation of the form = where a, b, c, d are integers and d R is irrational, and this implies that a = c and b = d (see Section 4.3). Hence the last equation requires that Nq,

= alpn

and alqn

+

qn-1

+

pn-1,

= pn-

P E R I O D I C C O N T I N U E D FRACTIONS

Solving these equations for pn-l and we find that

in terms of p, and

qn-1

115 Qn,

(4.40)

But from Theorem 1.4 we know that pnqn-1

- qnpn-1

=

and, with the values of p,-l and qn-l from (4.40)'this equation has the form pn(pn - alqn) - qn(Nqn - alp,) = (-1)"; that is, p:

(4.41)

- N&

= (-1)n.

If n is men, equation (4.41) becomes p 2,

- Nq,2

= (-1)n

=

1,

and hence a particular solution of Pell's equation z2 - Ny2 = 1 is Pn,

XI =

211

=

Qn.

If n is odd, then p 2,

- Nq,2

= (-1)n

=

-1,

and XI =

Pn,

Y1 = Qn

gives a particular solution of the equation x 2 - Nu2 = - 1. If n is odd and we still desire a solution the equation x 2 - Nu2 = 1, we move ahead to the second period in the expansion of fi, that is, out to the term an where it occurs for the second time. Notice that

KN

=

+ -1 ~

-

2

+

1

.

.

+an+2~1+

1

1 -

...

a,,

1

+Z+2al+ 1 -1

-1

' I + z +' . . + a n + a n + l +

so that the term then

1

1 -1

... +a2n+a2n+l+ * * when it occurs again, is actually the term

2 fin - Nq,,2

= (- 1)2n =

* ,

~ 2 , ;

1,

and so 51

=

p2n,

;YI =

92n9

gives us again a particular solution of the equation z2 - Ny2 = 1.,

CONTINUED FRACTIONS

116

N

-

TABLE 2 Continued Fraction for 1 / N

YI

21

2 3

1 2

5 6 7 8

2 5 8 3

10 11 12 13 14 15

3 10 7 18 15 4

3 2 5 4 1

17 18 19 20 21 22 23 24

4 17 170

1 4 39

9

2

55 197 24 5

12 42

26 27 28 29 30 31 32 33 34 35

5 26 127 70 11 1520 17 23 35

1 5 24 13 2 273

37 38 39

40

. . . .

.

.

-

15, 2 , O l 15, 1, 1, 3, 5, 3, 1, 1, 101

6 6 37 25 19

1 1

1 2

3 1 1

5

1

3 4

6 1 1 6 4

3

-1 +1 -1 +1 +1 +1

-1 +1 +1 -1 +1 +1

-1 +1

+1 +1 +1

+1 +1 +1 -1 +1 +1 -1

+I +1 +1 +1

+1 +1

-1 +1 +1 +1

PERIODIC CONTINUED FRACTIONS

117

The above analysis shows that we can always find particular solutions of the equation

x* - Ny2

1,

=

and sometimes particular solutions of the equation x 2 - Ny2 = - 1. Kot all equations of the form x2 - Ny2 = -1 can be solved. For example, i t can be proved (see Appendix I at the end of this book) that the equation x 2 - 3y2 = - 1 has no integral solutions. Here we shall confine our examples t o equations that have solutions. EXAMPLE 1. Find a particular solution of the equation x2 - 21y2 = 1. SOLUTION. Here N Table 2 is

=

21, and the continued fraction expansion given in

fi= [4, 1, 1, 2, 1, 1, 81 = [al, which shows that a, = a6, so that n shows that c6 = ti, so that 21

=

55,

= pe =

a2, a31 a41 a69 a61

2al],

6, an even number. A calculation

g1 =

q6

=

12,

and X;

hence xl

=

- 2 1 ~ ;= 55'

- 21 . 122 = 3025 - 3024 = 1;

55, g1 = 12 is a particular solution of the given equation.

EXAMPLE 2. Find a particular solution of the equation x2 - 29y2 = 1.

2/29 is

SOLUTION. The expansion of

6= [5, 21 1, 1, 2, 101 = [alp a2, so that n

=

a37 a4,

a6, 2al]j

5, an odd number. The first five convergents are 5- 1 1

11 2

-2

-

16 1 3

-70_ -- ~

-27, 5

13

5

.

q6

x1 = p5 = 70, yl = qs = 13, give z2 - 29y2 the value 702 - 29 . 132= -1 and not +l. Hence, we must move on to the next But

period. The next period gives the convergents 727 - 1 135

1524 1 283

__

2251 1 418

~-

-

3775 , 701

9801 -=1820

and so, if we take ZI =

we get X;

9801,

~1

=

1820,

- 2 9 ~ ;= 96059601 - 96059600 = 1.

PIO, qio

CONTINUED FRACTIONS

118

The solutions arrived at in Example 1 can be checked against Table 2. In this Table, opposite N = 21 we find the expansion of

fi= fi= [4, 1, 1, 2, 1, 1, 81, and further to the right we find listed a solution x1 = 55, y1 = 12 of the equation x 2 - 21y2 = 1. Likewise we can check Example 2, for the Table shows that

fi= 6= [5, 2, 1, 1, 2, lo] and gives a solution x1 = 70, y l = 13 of the equation x2 - 2 9 ~ 2= -1, which indicates that we have to move to the next period to obtain a solution of the equation x 2 - 29y2 = + l .

Problem Set 19 1. Show that x1 = 8, yl = 3 is a solution of the equation as indicated in Table 2.

2. Show that x4 - 13y2 =

equation

x1 =

18,

y1 = 5

x2

- 7y2 = 1,

is a solution of the equation

-1 , and proceed to the next period to find a solution of the x2 - 13y2 = 1.

4.9 How to Obtain Other Solutions of Pell's Equation

We have seen that Pell's equation 2 2 - Ny2 = 1, N a positive integer not a perfect square, can always be solved, but that not all equations of the form x 2 - Ny2 = -1 have solutions. However, if either of these equations has solutions, then the method outlined in Section 4.8 will always produce the least positive (minimal) solution; that is, it will always produce the two smallest integers xl > 0, > 0 such that 2: - Nyq = 1 or x: - Nu12 = -1. Once the least positive solution has been obtained, we can systematically generate all the other positive solutions. These statements will not be proved. We shall state the main theorems involved and illustrate them by examples.

THEOREM 4.4. If (21, yl) i s the least positive solution of x2 - Ny2 = 1, then all the other positive solutions (xn,yn) can be obtained f r o m the equation (4.42)

2n

+

yn

fi = (21 + y1

by setting, in turn, n = 1, 2, 3, . . .

f i > n

.

The values of Xn and y n are obtained from (4.42) by expanding the term (XI y11/W)" by the binomial theorem and equating the

+

P E R I O D I C C O N T I N U E D FRACTIONS

119

rational parts and purely irrational parts of the resulting equation. For example, if (zl, yl) is the least positive solution of $2 - NyZ = 1, then the solution (z2, y2) can be found by taking n = 2 in (4.42). This gives

xz

+

y2

IrN

=

+

(21

+

fl)z = (-8+ NU:) + (22131)

211

so that z2 = 2: Ny: and direct calculation shows that 2

22

- N$

=

y2

2x1~1.

a,

Vsing these values, a

+ Nu:)' - N(221~1)' + ~Nx:$ + N 2 ~-f 4N~:y:

= (2: = X:

- 2N~:y: + N2yf

= X; =

(x:

-

= 1,

since by assumption (XI, 311) is a solution of x2 - Ny2 = 1. It is easy to show that, if xn, yn are calculated by equation (4.42), then xi - Nyi = 1. We have, from (4.42), Xn

+

Yn

KN= ( X I + y1 f i ) ( x l +

y1

fi) . . . (21 + ~ 1 4 x 1 ,

where there are n factors in the expression on the right-hand side. Since the conjugate of a product is the product of the conjugates, this gives Zn

- ynN
0, such that

Any of the convergents pl/ql, p2/q2, . . . , p,/q,, . . . to the continued fraction expansion of a can serve as the fraction p/q in (5.2). It is possible to sharpen the inequality (5.2) as shown by the following theorem, stated here without proof.

THEOREM 5.1. Of any two consecutive convergents pn/qn and p,+l/q,+l to the continued fraction expansion of a, at least one (call it p/q) satisJies the inequality (5.3) Moreover, the inequality (5.3) has this interesting feature: If a i s any irrational number, and i f p/q i s a rational fraction in lowest terms, with q 2 1, such that

then it can be proved that p/q i s necessarily one of the convergents of the simple continued fraction expansion of a. 6.3 Hurwitz’s Theorem

Inequality (5.3) immediately suggests the following question concerning still better approximations. Given an irrational number a, is there a number k > 2 such that the inequality

(5.4)

-/.;I

1

45, then there exists only ajinite number of such rational approximations p / q to a, not an infinite number. Niven [8]gives an elementary proof that 6is the best possible number in this sense. One proof (by means of continued fractions) of Theorem 5.2 depends upon the fact that, in the continued fraction expansion of a, at least one of every three consecutive convergents beyond the first satisfies the inequality (5.6). In his original proof of Theorem 5.2, Hurwitz did not use continued fractions; instead he based his proof on properties of certain fractions known as the Farey sequences. For any positive integer n, the sequence F , is the set of rational numbers a/b with 0 5 a 5 b _< n, (a, b ) = 1, arranged in increasing order of magnitude. The first four sequences are:

0

F,:

1

i’ i’

These sequences have many useful properties; the one important for this study is: I f for any n, the irrational number 0 < 6 < 1 lies between two consecutive fractions p / q , r/s of the sequence F,,, then at least one of the three ratios p / q , ( p r ) / ( q s ) , r / s can be used for X / ~ J in the inequality

+

+

In order to make such an inequality valid also for an irrational number a > 1, we let B = a - n where n is the greatest integer less than a. Substituting for 6 in the above inequality, we obtain

+

where x’ = n y x. This is the central idea in Hurwitz’s proof. For complete details see LeVeque [7].

EPILOGUE

127

Mathematicians are never content with a “best possible result”, such as the constant 4 in Theorem 5.2. Such a statement always seems to stimulate further research. If a certain class of irrationals were ruled out, could this constant perhaps be replaced by a larger number? Indeed this can be done. The class of irrationals to be excluded consists of all numbers equivalent to the critical number [=4( 6 - 1) which forced us to accept 6as the “best possible’’ constant in the inequality (53). We shall show that all numbers equivalent to 4 have the same periodic part at the end of their continued fraction expansions as 5 has, and are therefore just as hard to approximate.

-

DEFINITION : Here a number z is said to be equivalent to a number y (in symbols, z y) if there are integers a, b, c, d satisfying the condit.ion (5.7)

ad-bc=

and such that

2

+1

can he expressed in terms of y by the fraction

+

-

+

For example, if y = fi and z = (2 fi 3)/(& l), z g because x = (a 1/2 b ) / ( c 1/2 d ) with a = 2, b = 3, c = 1, d = 1, and ad - bc = 2 - 8 = -1. It is easy t.0 see that the equivalence just defined has all the properties required of an cquivalence relation, namely that it be

+

+

--

--

(i) reflexive, i.e., every z is equivalent to itself (z (ii) symmetric, i.e., if z y, then y 5, (iii) transitive, i.e., if z 2/ and y z, then z z.

-

-

z),

An equivalence relation divides the set of all numbers into equivalence classes in such a way that each number belongs. to one and only one equivalence class. Now, if a real number cy has the continued fraction expansion =

it follows from

[a19a29 . . . 9 an, a n + l ] ,

a =

-

an+lpn

an+lqn

+ +

pn-1 Qn-1

p n q n - 1 - pn-lqn = (-l)n (see Theorem 1.41, that [cf. (5.7) and (5.8)]. Hence if cy and B are any two real numbers with continued fraction expansions

and from a

an+1

=

[al, a21

* *

. 3 an, a n + l ] ,

B

=

[bl,

b ~ .,. . k,Bm+l],

CONTINUED FRACTIONS

128

and if a,,+] = &+I, then cr -crn+1 -@,+I -/3, so a-8. In particular any two rational numbers 2 and y are equivalent, for their expansions can always be written in the form 2 =

[al, a2, . . . , an, 11,

y = [bl, b2, . . . , b,, 11;

- -

and since 1 1, z y . The question as to when one irrational number is equivalent t o another is answered by the following theorem, stated here without proof.

THEOREM 5.3. Two irrational numbers and only if cr =

[a,, az, . . . , a,,

P

[bl, bs, . . .

=

CY

and P are equivalent if

. . .I, 2 -, .-1;

CO, CI,c2,

bn, CO, C I , ~

that is, if and only if the sequence of quotients in same as the sequence in 0 after the nth.

(Y

after the inth i s the

Kow let us return to Hunvitz’s theorem. There are infinitely - 1 ) ; let us many irrational numbers equivalent to 5 = $(G suppose that each of these is expanded into a simple continued fraction. Then, by Theorem 5.3, from a certain place on, each of these expansions will contain the same sequence of quotients, C O , C I , c2, . . . , and hence all these equivalent irrationals play essentially the same role in Hunvitz’s theorem as the number [ = +(2/5 - 1) does. It seems reasonable to guess that if we rule out the number t and all irrationals equivalent to it, then the constant fi in Hurwitz’s theorem could be replaced by a larger number. In fact the following theorem can be proved.

THEOREM 5.4. Any irrational number /3 not equivalent to 5 = $(I - G ) has an infinity of rational approximations p / q which satisfy the inequality (5.9) There is a chain of theorems similar to this one. For example, if 6 is not equivalent to either &(fi - 1 ) or 2 / 2 , then the number fiin (5.9) can be replaced by any number less than or equal to a / 5 .

EPILOGUE

129

Recently interest has been shown in “lop-sided” or unsymmetrical approximations to irrational numbers. For example, the following theorem was proved by B. Segre in 1946, and a very simple proof using Farey sequences was recently given by Ivan Niven.t

THEOREM 5.5. For any real number r 2 0, an irrational number a can be approximated by injinitely many rational fractions p / q ‘in such a wag that

When r = 1, this is Hurwitz’s Theorem. For r # 1, notice that the lower bound is not just the negative of the upper bound, and the expression is unsymmetrical. Using continued fractions, R. hl. Robinson (1947) gave a proof of Segre’s theorem, and also proved that given Q > 0, the inequality

-

P

1

(di-

Q)q2

A'= Hence . t = 0,1,2, and the positive solutions are (2,y) = (4, 101), (26, 64), (48,27).

+

+

5. z = 15u - 5, y = 17u - 6. Positive solutions require that u and u > &, hence u = 1, 2,3, . . . ,

+

+

>

+

+

6. The solution of the equation 9z 13y = u v = 84 is 2 = 5 13t, y = 3 - 9t. Hence u = 9(5 13t), u = 13(3 - 9t), where t is any integer.

+

7. The solution of the equation 22: - 3y = 1 is z = 3u - 1, y = 2u - 1. Hence N = 202 2 = 60u - 18, where u is any integer. For example, when u = -1,

N

=

-78

=

+ -4(20) + 2 = -3(30)

- 12.

Set 6, page 42 (In all cases t

=

0, f l , +2, f 3 , . . .)

++ [O, 1,3,41, n 4, zo x + tb 4 + 17t, y n 5, (b) ++ 10, 1,3,3, 11,

1. (a)

=

=

= 20

=

z = 20 (c)

+ tb

=

=

13

$9 = 11, 6, 4, 21, 2

(d)

= q3 =

=

+ 17t,

n = 25

4,

+ 56t,

&? = [1,6,4,1,11, 2 =

=

n

31

+

yo

20 =

93

y = 29

+ t~

=

=

10

25, yo 65t.

+

5, zo = 44 = 31, yo 56t, 2/ = 36 65t.

+

20 = q 5 = 36,

y

=

p 3 = 3, hence

yo = p4 = 10, hence

44 = 13,

y = yo 20 =

=

+ t~ = 3 + 13t.

=

(el #$ = [O, 1, 6,4, 1, 11, n = 6, 2 = 36 65t,

+

=

4, yo

31

+ 56t.

+ 13t.

= p3 =

29, hence

= p4 = 36,

hence

yo = 7.1, = 31, hence

S O L U T I O N S TO P R O B L E M S

145

Set 7, page 44 (In all cases t

=

0, +1, +2, . . .)

= 3, e 5, x = cxo + bt 20 + 17t, + at = 15 + 13t. Check: 13(20+ 17t) - 17(15+ 13t) 5. (b) xo 25, yo = 29, c 7, x = cxo + bt = 175 + 56t, y cyo + at = 203 + 65t. (c) xo = 29, yo = 25, is a particular solution of 562 - 65y = -1; hence c = 3, x cxo + bt = 87 + 65t, y = cyo + at 75 + 56t.

1. (a) xo

=

4, yo

=

=

y = QO

=

=

=

=

=

=

Set 8,page 48

-

1. (a) The g.c.d. of 183(= 3 * 61) and 174(= 2 * 3 29) is 3, and since 3 divides 9 the equation is solvable. Divide both sides of the given equation by 3 and solve the resulting equation 612 58y = 3. We first solve the equation 61x - 58y = 1 for which the espansion % = [l, 19,2, 11 shows that xo = qn-l = 39, go = pn-l = 41. Hence the solution of the given equation, according to equation (2.28), is

+

x

= Cqn-1

y = at

- tb = 3

*

- 58t = 117 - 58t, - 3 41 = 61t - 123.

39

- C P , - ~ = 61t

*

(b) In this case we must solve the equation 61.c - 58y = 3, from which the solution of the given equation according to (2.23) is

x

=

cxo

+ bt

=

117

+ 58t,

y =C

+ at

~ O

123

+ 61t.

(c) An unsolvable equation since 77 = 7 * 11 and 63 = 32* 7 so the

.

g.c.d. of 77 and 63 is 7 and does not divide 40( = 23 * 5). (d) Since 34( = 2 * 17) and 49( = 7*) are relatively prime, we have only to solve the given equation by the methods of Section 2.4. The required solution is x = 65 494 y = 45 34t. (e) x = 65 - 49t, y = 34t - 45. (f) The g.c.d. of 56( = Z3 * 7) and 20( = 22* 5) is 4 and does not divide 11. The given equation has no integral solutions.

+

+

+

2. The solution of the equation l l x 7y = 68 is x = 136 - 7t, y = l l t - 204. The only solution with both x and y positive is x = 3, y = 5 given by t = 19.

+

3. From the hint we find that 7x 9y = 90. The general solution of this equation is x = 360 - 9t, y = 7t - 270. For positive values of a and b it is sufficient to require that x 2 0, y 2 0, or that t be an integer < 360/9 and > 270/7. Thus we caki take t 39 and t 40. When t = 39, x = 9, y = 3 and a = 68,b = 32. When t 40, x = 0, y = 10 and a = 5, b = 95.

-

-

4. The general solution is x = 1200 - :7t, t = 70 leads t o the only positive solution, x

-

-

= 13t 900. The = 10, y = 10.

value

C O N T I N U E D FRACTIONS

146

Set 9, page 59 1. Expansions are given in the problems. The first five convergent8 are:

(a) 2i i

2. (a) Let

2 , -229 5 9

49 20

- 1

(C)';' 6 i7 ' -13 9 2

218 89

1

z=[2,2,1=2+-,

Y

.-

2+d6 2/=-=2

1

7p

9

Hence

a

Y=l+i+i+z+y. Then

- 1Oy - 1 = 0,

Hence z = 5

-

59

and z = 2 + ( d 6 - 2 ) = 4 6 .

d6-2

(b) Let z = 5 + y11

y=2+4+Y

46 7

- 9

or

Y =

5

+ 7

6

1

=

6

-

5

+ (6 - 5) = 1/32.

3. To show that AH = 4' see Figure 3, note that in triangle AOD, 72 82 7' 8' (AD)' = - From the similar triangles AGF and AOD we see that 8'

+ .

and, since A F

+

= f,

4' (AG)' = -* 72 8'

+

On the other hand from the similar triangles AHF and AGD we see that A F / A D = AH/AG. But we know already that A F / A D = ,4G/1. Hence, by division, 1 = - AH

or

AH==-. 7'

42

+ 8'

6. In the nth yrar, the total number of branches, F,, consists of the number of branches 0, that are a t least one year old and the number of branches

147

SOLUTIONS TO PROBLEMS

Yn that are less than one year old. In symbols, Fs = 0, the next year, there are

Fn+1 = 20,

+

Yn

=0s

+ + On

Yn = Fn

+ Y,.

During

+ 0,

branches. Since the number of at-least-one-year-old branches constitutes the total number of branches of the previous year, 0, = F,-1. Thus

Fn+1

=

Fn

+ F,+1

for

n = 2,3,. . *

and F , = 1 (because only the trunk was present during the fist year) yield the recursion formula for these Fibonacci numbers.

8. Firat solution: Construct the square ABCD of side x = A B ; see Figure 13a. Construct the point E such that A E = E D and draw EB = 4 4%. With E aa center and radius EB describe the arc BF.

Figure 13a

CONTINUED FRACTIONS

148

Then

AG

=

AF

EF

=

(6 - 1) = -X

- A E = ! 1 / i x - -1 2 = ! x . 2

2

2

i

7

+

where r = 4(

Q


-=l.

Q P - 6< 0, Ly'

-+,

=

4, 5, 6, 7, 8,9.

=

1,

SOLUTIONS T O PROBLEMS

By the same procedure, for P

=

4, 5, 6, we find

4

+

fiwith

k = 3, 4,

. . . , 10; 5 + &

and

6 +dZ ~-

with m

1, 2,

k

m

153

with I

= 2, 3,

_ I _ -

1

=

.. , 11;

. . . , 12.

Set 17, page 110 1. a = 1

+ di> 1, 0. Also

and

a' = 1 1

+ d2 = 2 +-,

a = [2, 2,2,

. . .] = [3].

>

1, a' =

2. a = d8 =

[2,

i3.

fi = 1 - 1.414 . . . 1

- d8

+ d2 = a,

al = 1

a1

lies between -1

does not lie between -1

hence

and 0.

Set 18, page 112

(Ye

= a2,

where a2 is a reduced quadratic irrational. Hence

Notice that a and a1 are not reduced, but that 3 - d G

a2 =

< o;

7 7 hence a2 is reduced and the continued fraction is periodic from then on.

Set 19, page 118 1.

d?

= [2, 1, 1, 1,4]. The convergents are 2/1, 3/1, 5/2, 8/3 = p d q 4 so p 4 = x1 = 8, q4 = yl = 3, and

X:

-7 ~ = : 64 - 7(9)

=

64 - 63

=

1.

154 2.

CONTINUED FRACTIONS

fi= 13, 1, 1, I , 1, 61. The first five convergents are 3/1, 4/1, 7/2, 11/3, 18/5 = p s / q s , so p s = x1 = 18, q s = yl = 5 gives a solution of 2 2 - 13y2= -1. Proceeding to the tenth convergent we find plo/qlo = 649/180. Thus x 2 = 649, YZ = 180 is a solution of ' 2 - 13y2 = 1. Set 20, page 121

1. According t o Theorem 4.4, the nest two solutions, ( 2 2 , y2) and are obtained from z2 y2 = (zl y1 v%)~ and

+ v'a

23

+ y3 fi

+

+

22

= 2:

ya),

+ yl f i l s . + y2 fi + 18y; + 2zly1 6 8 .

=

(21

The first relation yields 2 2 = 2: Since A B z / D = C E d B if and only if A and since z1 = 17, yl = 4, we have

+

(23,

+ 1 8 ~ := (17)' + 18(4)2

=

=

C and B

=

E,

577,

yz = 2x1~1= 2 . 17 . 4 = 136,

and 22'

- 1 8 ~ := (577)' - 18(136)2= 1.

From the relation for 23

+ ya d6 =

23,

we have

2:

-k 3z:yl d E + 3zly:18 + yi18 dG + 54Zly: + (32:yl + 18~:)fi

= 2:

SO that 23

= 2:

+ 54X1y:,

ya

=

3Z:yi

+ 18~:.

If 17 is substituted for z1 and 4 for yl, the relation zi - 18y; may be verified. 2. According t o Theorem 4.5, the next solution of x2 - 13y2 = -1 obtained from 23

z1 = 18,

=

(21

= 2:

=

solution 28 2: (zr, y,) of the equation x2 - 13y2= 1 are obtained from x2

is

+ 39Zly: + (3Z:yl + 13~:)dEi + yl y l 5 is the minimal solution which determines the next = + 39z1y:, y3 = 3z:yl + 13y:. Solutions yz) and

+ dz y8

= 1

(22,

+ y2 fi= (zl + yl fi)2 and + y4 fi= (zl + yl fi)4. 24

The computations are left t o the diligent reader. 3. Table 2 indicates that u1 = 1, u1 = 1 is the minimal solution of u2 - 2u2 = -1. This yields u1= 1, ul = n1= 1, m, = 2, z1 = 4,

SOLUTIONS TO PROBLEMS y1 =

3,

z1

=

155

5; X:

Other solutions of u2

+ y;

=

+ 202

32 + 42

=

=

25

= z21'

1 are obtained from

uk

+

Uk

mz

=

5, x2 = 20, y2 = 21, z2 = 29;

& = (UI -k Ui &)k = (1 + &)lC for k = 2, 3, . . . . Thus, for k = 2, uz + 02 & = 3 + 2 6, and u2 = 3, u2 = n2 = 2, X;

For k

=

4- yi

+

=

841

=

2:.

+

+

3, U S US & = (1 &I3 = 7 5 &, and u1 = 7, 5, ma = 12, xs = 120, U S = 119, zs = 169;

vs = ns =

+ 14161 28561 = For k = 4, u4 + 6 2 = (1 + d5)' = 17 + 12 d2, and u4 = n4 = 12, m4 = 29, x4 = 696, v4 = 697, z4 985; X: + y: = 484416 + 485809 970225 = X:

3- 2/:

=

14400

=

2:.

u4

=

17,

=

u4

=

2 .:

4. As explained in the statement of Problem 3, Set 20, page 121, the lengths

of the sides may be written x = m 2 - n2,

y = 2mn,

z = m2

where m and n are positive integers, m t,an -8 2

sin 8

=

1

-

-

> n.

+ n2

Therefore

+n3

2mn/(m2

+ cos 8 - 1 + (x/z) - 1 + (m2- n2)/(m2+ n2) Y/Z

=

n . m

If we could find sequences of integers nl, n2, . . . and mi, m2, . . . such that the ratios nl/ml, n2/m2, . . . approach l / d $ , then 8/2 would approach 30" and 8 would approach 60". To find these sequences, we convert v'3 into the continued fraction &=1+1

1 1 1 1+ 2 + i + 2 +

...

and let mi and ni be the numerator and denominator, respectively, of the convergent ci. We find mi:

2, 5, 7, 19, 26, 71, . . .

n,:

1, 3, 4, 11, 15, 41,

...

.

and corresponding triangles with sides (3, 4, 5), (16, 30, 34), . . . The sixth triangle has sides (3360, 5822, 6722) and its angle 8 is between 60" and 61°, but much closer to 60".

CONTINUED FRACTIONS

156

Set 21, page 130

+ 4%)

1. The first six convergents to a = i ( 1 = 1.3874 . . are +, 8, 4, g, +#, 38, and the convergent g satisfies the inequalities (5.6); note that also satisfies (5.6).

+

2.

-0

Ftj:

1

3. In Fr, a

1 2

1 , - 1 1 - 11 -21 5 4 3 5

=

.387 . . . lies between 9 and

- 1

3 5

2 -,

1

- 1

4 5

3 4

- 1

3

1 1

- 1

-

%

+. Of the numbers

the first satisfies (5.6). The other two come close but do not make it. 2.

x

5.

- (7)(7) = 1.

because (-lo)(-5)

x-y

=

IT] and

y = [-2, 1, 1, 4, i] =

-169 118

+ +

ax b , with a = 1, b = 0, c cx d ad - bc = 1 - 0 = 1. Hence x - x .

(i) Since x

(ii) If x

=

=-

___ and ad - bc cy

+d

=

-dX+b y=-=-1 cx-a

where A D - BC (iii) Since x

-

=

y and y

x=cy

ad

-

+d

where, respectively, ad

X =

a ( s ) + b

- bc =

=

lh

0, d

=

1, we have

5 1, then Ax+B

Cx+ D + l . Hence y

N

x.

z, we can write

and

- bc =

y = - i a’z

c’z

+ 1 and

+ b’

+ d’ a’d’ - b’c’

+ bc’)z + ab‘ + bd’ (ca‘ + dc’)z + cb’ + dd’

- (aa’

=

+ 1. Then

=-,A z + B Cz

+D

SOLUTIONS T O PROBLEMS

and AD

157

- BC = (UU’ + bd)(cb’ + dd’) - (ab‘ + bd’)(cd + dc‘) = d d d ’ + bb’cc’ - a’bcd’ - ab’c’d = dd’(ad - bc) - b’c‘(ud - bc) = (ad - bc)(a’d’ - b’c‘) fl.

=

Set 22, page 133 1.

diii = [5,,10hence P

2.

=

so we must calculate

2, Q

=

5, and 29

=

22

@a: aa =

2

+ 1/29 , 5

+ 52.

dz

= [20, 1, 4, 4, 2, 2, 1 x 1 3 , 1, 1, 1, 1, 13, 3, 1, 2, 2, 4, 4, 1, 401, so we must calculate all: a11

=

12+ dG ~17

, hence

P

=

12, Q = 17 and 433 = 122

+ 172.

3. Since lh is irrational it is impossible to find two integers a and b such that 2


l

!l

we always have p2 - 2qz = 51

or

p2 f 1 = 2q2 = q 2

+

qp.

Hence the second part of the problem can be solved by values of p and p3 1 = 2q*, or pz - 1 = 2q’.

p such that

+

References

The books listed below either contain chapters on continued fractions, or deal with subject matter that has been referred to in the text. No attempt has been made to compile a complete bibliography. The standard treatise on continued fractions is Perron’s Kettenbriiche, but this book is for the specialist. The only extended account of the subject in English is that given in Vol. I1 of Chrystal’s Algebra, an old-fashioned yet still valuable text. The book by Davenport is very good reading, for he gets to the heart of the matt,er quickly and with very little fussing. 1. Edwiti Beckenbach and Richard Bellman, A n Introduction to Inequalities, New Mathematical Library 3, Xew York: Random House, Inc., 1961.

2. G. Chrystal, AZgebra, vol. 11, Edinburgh: Adam and Black, 1889; reprinted, Kew York: Chelsea, 1959.

3. H. Davenport, The Higher Arithmetic, London: Hutchinson’s University Library, 1952. 4. L. E. Dickson, History.of the Theory of Numbers, vols. I, 11, 111, Washington: Carnegie Institute of Washington, 1919; reprinted, New York: Chelsea, 1950.

5. G. H. Hardy and E. M. Wright, A n Introduction to the Theory of Numbers, 4th ed., Oxford: Clarendon Press, 1960. 159

160

CONTINUED FRACTIONS

6. Sir Thomas L. Heath, Diophantus of Alexandria, A Study in the History of Greek Algebra, 2nd ed., Cambridge: Cambridge University Press, 1910.

7. W. J. LeVeque, Topics in Number Theory, vols. I and 11,Reading, Mass. : Addison-Wesley, 1956. 8. Ivan Niven, Irrational Numbers, Carus Monograph 11, New York: John Wiley and Sons, 1956. 9. Ivan Siven, Numbers: Rational and Irrational, Xew hlathematical Library 1, Xew York: Random House Inc., 1961. 10. 0. Ore, Number Theory and Its History, Xew York: McGrawHill, 1949. 11. Oskar Perron, Die Lehre uon den Kettenbriichen, Leipzig and Berlin: Teiibner, 1929.

12. Raphael M. Robinson, Unsymmetrical Approximations of Irrational Numbers, Bulletin American Math. Soc., vol. 53 (1947) pp. 351-361. 13. D. E. Smith, History of Mathematics, vols. I and 11, Kew York: Dover Publications, Inc., Reprint, 1958. 14. H. S. Wall, Analytic Theory of Continued Fractions, New York: D. Van Kostrand Company, Inc., 1948. 15. Leo Zippin, Uses of Injnity, New Xlathematical Library 7, New York: Random House, Inc., 19G2.

Index

absolute value, 72 acyclic, 95 approximation theorems, 7Off Archimedes, 58 “cattle problem” of, 90, 113 Aryabhata, 29 associate, 103

de Gelder, Jakob, 60 Dickson, 89-90 Diophantine equations, 31ff general, 37 minimal solution of, 118 particular solution of, 37 solutions of, 89 discriminant, 98 Dirina Proportione, 82

Babylonians, 58 Beckenbach, E., 9 Bellman, R., 9 Bombelli, Rafael, 29, 134 Brouncker, Lord, 30, 89, 135 Cataldi, Pietro Antonio, 29, 134 coconuts and monkeys, 48ff conjugate, 99 continced fraction, 7 finite simple, 7 geometrical interpretation of, 77 infinite simple, 53-54, 66 interpretation of, 77 periodic, 88ff periodic part of, 56 purely periodic, 9Off simple, 7 for 112ff symmetrical periodic part of, 113 terminating, 7 uniqueness, 11 convergents, 6, 19 differences of 27, 58, 61 Coxeter, H. 5.M., 61

a,

el 52, 74-75, 135-136 equivalence classes, 127 equivalent, 127ff Eratosthenes, 90 Euclid’s algorithm, 16 Euclid’s Elements, 17 Euler, 30, 32, 35, 132, 135

Farey sequences, 126 Fermat, 89, 132 Fibonacci numbers, 60, 81-82, 84, 137, 147 Galois, 95 Gardner, Martin, 50 Gauss, 132, 138 geometric constructions, 59 golden section (mean), 61, 82-83 greatest common divisor, 17 Hardy, 123, 130 Heath, 90 Hildebrand, F. B., 30 Hurwite’s theorem, 124ff, 128 Huygens, Christiaan, 30

161

CONTINUED FRACTIONS

162

indeterminate equations Diophantine, 316, 89 having no integral solutions, 131ff

Pell’s equation, x* - Ny*= f l , 89, 113ff, 118ff, 123 quadratic equation, 121 ux by = C, 31 ax - by = f l , 36 ux - by = C, (a, b) = 1, 42 ux by = C, (a, b) = 1, 44 AX f By = fC, 46 integral part of x, [XI, 108 irrational numbers, 51ff approximation of, 123ff expansion of, 51ff

+

+

partial quotients, 8, 19 partial sums, 64-65 Pell, John, 89 Pell’s equation, x* - Ny* = f l , 89, 113ff,118ff, 123 insoluble, x 2 3y2 = -1, 131ff minimal solution of, 118 Perron, 129 phyllotaxis, 61 pi ( T ) , 52, 58, 60, 76, 136-137 prime number, 19 Pythagorean equation, 121

-

quadratic irrational, 51 reduced, 89, 96-98, lOOff quadratic surd, 51, 88 reduced, 96-98, 1OOff

Klein, F., 77 Lagrange, 30, 56, 89, 95, 139 Lagrange’a theorem, 110ff Lambert, 30, 136, 138 Laplace, 139 lattice points, 77 Legendre, 132, 136 Le Veque, 126 limit, 44, 63 logarithms common, 74 method for calculating, 84ff natural, 74 Minkowski, 130 Newman, James R., 90 Niven, Ivan, 52, 123, 126, 129 number algebraic, 52 irrational, 51ff prime, 19 transcendental, 52

rational fractions expansion of, 5, 8, 13 reflexive, 127 Rhind Papyrus, 58 Robinson, R. M., 129 Schwenter, Daniel, 29 Segre, B., 129 Serret, 132 Shanks, Daniel, 84 Smith, D. E., 134 square root of 2 52 Stern, 137 Stieltjes, 130 symmetric, 127

(4/2),

transitive, 127 uniqueness,

16

Ore, O., 32

Wall, 130 Wallis, John, 30, 135 Wright, 123, 130 Wythoff, W. A., 61 game, 61

Pacioli, Luca, 82

Zippin, L., 66