Notes on Continued Fractions for Math 4400

Similar documents
CHAPTER 1 REAL NUMBERS KEY POINTS

CONTINUED FRACTIONS, PELL S EQUATION, AND TRANSCENDENTAL NUMBERS

Lesson 3.5 Exercises, pages

MATH 4400 SOLUTIONS TO SOME EXERCISES. 1. Chapter 1

Math 3 Variable Manipulation Part 4 Polynomials B COMPLEX NUMBERS A Complex Number is a combination of a Real Number and an Imaginary Number:

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Math 192r, Problem Set #3: Solutions

Introduction to Number Theory

Lecture 2: Continued fractions, rational approximations

PELL S EQUATION, II KEITH CONRAD

3 Finite continued fractions

x 9 or x > 10 Name: Class: Date: 1 How many natural numbers are between 1.5 and 4.5 on the number line?


Solving Quadratic Equations by Formula

Unit 2-1: Factoring and Solving Quadratics. 0. I can add, subtract and multiply polynomial expressions

UNCC 2001 Algebra II

King Fahd University of Petroleum and Minerals Prep-Year Math Program Math Term 161 Recitation (R1, R2)

Math 473: Practice Problems for Test 1, Fall 2011, SOLUTIONS

Complex Numbers: Definition: A complex number is a number of the form: z = a + bi where a, b are real numbers and i is a symbol with the property: i

Math 2 Variable Manipulation Part 2 Powers & Roots PROPERTIES OF EXPONENTS:

Math 118: Advanced Number Theory. Samit Dasgupta and Gary Kirby

Table of Contents. 2013, Pearson Education, Inc.

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

Pell s equation. Michel Waldschmidt

Solutions to Assignment 1

be any ring homomorphism and let s S be any element of S. Then there is a unique ring homomorphism

MATH98 Intermediate Algebra Practice Test Form A

THE UNIT GROUP OF A REAL QUADRATIC FIELD

+ 1 3 x2 2x x3 + 3x 2 + 0x x x2 2x + 3 4

Equations in Quadratic Form

Remember, you may not use a calculator when you take the assessment test.

Numbers. 2.1 Integers. P(n) = n(n 4 5n 2 + 4) = n(n 2 1)(n 2 4) = (n 2)(n 1)n(n + 1)(n + 2); 120 =

1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n).

18-29 mai 2015: Oujda (Maroc) École de recherche CIMPA-Oujda Théorie des Nombres et ses Applications. Continued fractions. Michel Waldschmidt

Math 101 Study Session Spring 2016 Test 4 Chapter 10, Chapter 11 Chapter 12 Section 1, and Chapter 12 Section 2

Math /Foundations of Algebra/Fall 2017 Foundations of the Foundations: Proofs

ON THE ELEMENTS OF THE CONTINUED FRACTIONS OF QUADRATIC IRRATIONALS

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

Continued Fractions: Introduction and Applications

Reading Mathematical Expressions & Arithmetic Operations Expression Reads Note

2 Series Solutions near a Regular Singular Point

Section 11.1 Sequences

1 + lim. n n+1. f(x) = x + 1, x 1. and we check that f is increasing, instead. Using the quotient rule, we easily find that. 1 (x + 1) 1 x (x + 1) 2 =

Prime Numbers and Irrational Numbers

MA22S3 Summary Sheet: Ordinary Differential Equations

Algebra I Unit Report Summary

Section 5.2 Solving Recurrence Relations

Series of Error Terms for Rational Approximations of Irrational Numbers

Solving x 2 Dy 2 = N in integers, where D > 0 is not a perfect square. Keith Matthews

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

1 Continued Fractions

Test 4 also includes review problems from earlier sections so study test reviews 1, 2, and 3 also.

Math221: HW# 7 solutions

FIFTH ROOTS OF FIBONACCI FRACTIONS. Christopher P. French Grinnell College, Grinnell, IA (Submitted June 2004-Final Revision September 2004)

8. Given a rational number r, prove that there exist coprime integers p and q, with q 0, so that r = p q. . For all n N, f n = an b n 2

The Real Number System

1 Examples of Weak Induction

Basic Fraction and Integer Operations (No calculators please!)

1 2 1 = = =

Ch. 7.6 Squares, Squaring & Parabolas

Legendre s Equation. PHYS Southern Illinois University. October 18, 2016

CHAPTER 1. Review of Algebra

PUTNAM PROBLEMS SEQUENCES, SERIES AND RECURRENCES. Notes

Subtraction games. Chapter The Bachet game

CHAPTER EIGHT: SOLVING QUADRATIC EQUATIONS Review April 9 Test April 17 The most important equations at this level of mathematics are quadratic

CONTINUED FRACTIONS. 1. Finite continued fractions A finite continued fraction is defined by [a 0,..., a n ] = a 0 +

AS PURE MATHS REVISION NOTES

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

SECTION Types of Real Numbers The natural numbers, positive integers, or counting numbers, are

MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

Objective Mathematics

Number Theory Marathon. Mario Ynocente Castro, National University of Engineering, Peru

Section September 6, If n = 3, 4, 5,..., the polynomial is called a cubic, quartic, quintic, etc.

Polynomial Functions

Summary Slides for MATH 342 June 25, 2018

Pell s Equation Claire Larkin

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

A Level. A Level Mathematics. Proof by Contradiction (Answers) AQA, Edexcel, OCR. Name: Total Marks:

Gaussian integers. 1 = a 2 + b 2 = c 2 + d 2.

. As the binomial coefficients are integers we have that. 2 n(n 1).

Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018

( 3) ( ) ( ) ( ) ( ) ( )

Math 480/580 Number Theory Notes. Richard Blecksmith

In Exercises 1 12, list the all of the elements of the given set. 2. The set of all positive integers whose square roots are less than or equal to 3

Solving Pell s equation using the nearest square continued fraction

2k n. k=0. 3x 2 7 (mod 11) 5 4x 1 (mod 9) 2 r r +1 = r (2 r )

Problem Set 5 Solutions

Foundations of Discrete Mathematics

Summer Prep Packet for students entering Algebra 2

3.4. ZEROS OF POLYNOMIAL FUNCTIONS

Natural Numbers Positive Integers. Rational Numbers

SEVENTH EDITION and EXPANDED SEVENTH EDITION

Section 7.2 Solving Linear Recurrence Relations

8. Dirichlet s Theorem and Farey Fractions

Proofs. Chapter 2 P P Q Q

Power series solutions for 2nd order linear ODE s (not necessarily with constant coefficients) a n z n. n=0

Math 200 University of Connecticut

ON DIRICHLET S CONJECTURE ON RELATIVE CLASS NUMBER ONE

SOLUTIONS TO PROBLEM SET 1. Section = 2 3, 1. n n + 1. k(k + 1) k=1 k(k + 1) + 1 (n + 1)(n + 2) n + 2,

Transcription:

. Continued fractions. Notes on Continued Fractions for Math 4400 The continued fraction expansion converts a positive real number α into a sequence of natural numbers. Conversely, a sequence of natural numbers: a 0, a, a, a 3,... is converted into a sequence of rational numbers via: ( ) a 0, a 0 + a, a 0 + a +, a 0 + a a +, a + a 3 Thus, for example, the sequence 3, 7, 5, is converted into: 3 = 3, 3 + 7 = 7, 3 + 7 + 5 which are excellent approximations of π. = 333 06, 3 + 7 + 5+ = 355 3 We will find some useful general properties of continued fractions by replacing numbers a 0, a, a, a 3,... with a sequence of variables: q 0, q, q, q 3,... and considering the sequence of rational functions in many variables: q 0 = q 0, q 0 + = q 0q +, q 0 + q q q + = q 0q q + q 0 + q q q q + Definition. Define polynomials f n and g n by: (in lowest terms). q 0 + q +...+ qn = f n(q 0,..., q n ) g n (q,..., q n ) Examples. (o) f 0 (q 0 ) = q 0 and g 0 =. (i) f (q 0, q ) = q 0 q + and g (q ) = q. (ii) f (q 0, q, q ) = q 0 q q + q 0 + q and g (q, q ) = q q +. Proposition. (a) (Each g is an f) g n (q,, q n ) = f n (q,..., q n ). (b) (Recursion) f n (q 0,, q n ) = q 0 f n (q,, q n )+f n (q,, q n ).

Proof. By definition of the polynomials f n and g n, we have: hence: q 0 + q + q +... + qn q +...+ qn = q 0 + = f n (q,..., q n ) g n (q,..., q n ) ( fn (q,...,q n) g n (q,...,q n) ) = q 0 + g n (q,..., q n ) f n (q,..., q n ) = q 0f n (q,..., q n ) + g n (q,..., q n ) f n (q,..., q n ) and the denominator gives us (a), and the numerator gives us: f n (q 0,..., q n ) = q 0 f n (q,..., q n ) + g n (q,..., q n ) which, with g n (q,..., q n ) = f n (q,..., q n ) from (a), gives us (b). Using the recursion, we can get a few more of these polynomials: Example. (iii) f 3 (q 0, q, q, q 3 ) = q 0 (q q q 3 + q + q 3 ) + (q q 3 + ) (iv) f 4 (q 0, q, q, q 3, q 4 ) = = q 0 q q q 3 + q 0 q + q 0 q 3 + q q 3 + = q 0 (q q q 3 q 4 + q q + q q 4 + q 3 q 4 + ) + q q 3 q 4 + q + q 4 = q 0 q q q 3 q 4 + q 0 q q + q 0 q q 4 + q 0 q 3 q 4 + q q 3 q 4 + q 0 + q + q 4 Notice that the first term is always the product of all the q s. In fact: Euler s Continued Fraction Criterion: f n = q 0 q n + q 0 q n + q i i q i+ i j > q 0 q n q i q i+ q j q j+ + i.e. the other terms are obtained by removing consecutive pairs of q s from the product of all the q s. Example. f 5 = q 0 q 5 + q q 3 q 4 q 5 + q 0 q 3 q 4 q 5 + q 0 q q 4 q 5 + q 0 q q q 5 + q 0 q q q 3 + +q 4 q 5 + q q 5 + q q 3 + q 0 q 5 + q 0 q 3 + q 0 q + Proof. The criterion is true for f 0 (q 0 ) = q 0 and f (q 0 q ) = q 0 q +. By the recursive formula (b) above: f n (q 0,..., q n ) = q 0 f n (q,..., q n ) + f n (q,..., q n )

By induction, f n and f n may be assumed to satisfy the criterion, and it then follows from the formula that f n also satisfies the criterion! Corollary. (The palindrome corollary) f n (q 0,..., q n ) = f n (q n,..., q 0 ) Proof. Euler s criterion defines the same polynomial when the order of the variables is reversed. The most important corollary is now the following. Corollary. (An even better recursion) f n (q 0,..., q n ) = q n f n (q 0,..., q n ) + f n (q 0,..., q n ) Proof. Using Corollary and Proposition (b), we have: f n (q 0,..., q n ) = f n (q n,..., q 0 ) = q n f n (q n,..., q 0 )+f n (q n,..., q 0 ) = = q n f n (q 0,..., q n ) + f n (q 0,..., q n ) This corollary, together with the initial conditions: f 0 (q 0 ) = q 0, f (q 0, q ) = q 0 q + is going to turn out to be extremely useful. Back to Numbers. We now apply the polynomial results to continued fractions associated to natural numbers. Definition. Given a sequence of natural numbers a 0, a, a,..., let: (a) A n := f n (a 0, a,..., a n ) and (b) B n := g n (a,..., a n ) = f n (a,..., a n ) Gathering together what we have done with polynomials, we have: Proposition. (a) The sequence of rational numbers (*) coming from the sequence of natural numbers a 0, a, a,... is: A 0 = a 0 B 0, A = a 0a + A A 3,,,... B a B B 3 (b) The numbers A n and B n satisfy the Fibonacci-like rule: A n = a n A n + A n and B n = a n B n + B n for n Proof. (a) is from the definition, and (b) follows from Corollary. Example. Taking the sequence 3, 7, 5, again, we have: A 0 = 3, A =, A = 5 + 3 = 333, A 3 = 333 + = 355 B 0 =, B = 7, B = 5 7 + = 06, B 3 = 06 + 6 = 3 giving the sequence of rational approximations to π that we saw earlier. 3

4 Another Example. Take the sequence,,,,.... We have: A 0 =, A =, A = + = 3, A 3 = 3+ = 5, A 4 = 5+3 = 8,... B 0 =, B =, B = + =, B 3 = + = 3, B 4 = 3+ = 5,... which are two copies of the Fibonacci sequence offset by one. The associated sequence of rational numbers: 3,,, 5 3, 8 5, 3 8, 3,... converges pretty rapidly to the golden mean φ = ( + 5)/.. Convergence. We now have some powerful tools for analyzing the sequence of rational numbers that arise from a continued fraction. Proposition 3. Let a 0, a, a,... be a sequence of natural numbers, and let A n and B n be the natural numbers from Proposition. Then: (a) Each quadruple of numbers A n, B n, A n+, B n+ satisfies: A n+ B n A n B n+ = ( ) n (b) Each pair (A n, B n ) is relatively prime so A n /B n is in lowest terms. (c) If the sequence a 0, a, a,... is infinite, then there is a limit: A n lim = α and each n B n α A n B n < < B n B n+ Bn Proof. We prove (a) by induction. First of all: A B 0 A 0 B = (a 0 a + ) a 0 a = ( ) 0 = Using Proposition (b), we have: A n+ B n+ A n+ B n+ = (a n+ A n+ +A n )B n+ A n+ )(a n+ B n+ +B n ) = A n B n+ A n+ B n = ( )(A n+ B n A n B n+ ) which proves it. Then (b) follows directly from (a), since any common factor of A n and B n would be a factor of ( ) n. Finally, for (c), we notice that (a) also gives us: A n+ A n = ( )n B n+ B n B n B n+ which means that the differences of consecutive terms in the sequence: A 0 A A A 3,,,,... B 0 B B B 3 are alternating in sign and decreasing to zero. This implies that the sequence has a limit, and that the limit is between any two consecutive terms, which gives (c).

5 Example. The sequence,,,,... gives: A 0 =, A = 3, A = 7, A 3 = 7, A 4 = 4 B 0 =, B =, B = 5, B 3 =, B 4 = 9 which give rational numbers: A 0 A A A 3 A 4 =, =.5, =.4,.47,.44 B 0 B B B 3 B 4 that alternate above and below, and seem to converge to it. Getting to the point (finally) which is to convert α into a i s. Case. α = r 0 is a rational number > in lowest terms r Apply the Euclidean algorithm to the (relatively prime) pair (r 0, r ): r 0 = a 0 r + r ; r = a r + r 3 ; r n = a n r n + ; r n = a n + 0; But the right column gives us: α = a 0 + r = a 0 + r which exactly tells us that. r 0 = a 0 + r r r r = a + r 3 r r r n r n r n = a n a + r r3 = = a 0 + = a n + r n a +... a n + an α = r 0 = A n r B n for the (finite!) sequence a 0, a,..., a n of natural numbers. Bonus! From Proposition 3(a), we get: r 0 B n r A n = ( ) n which tells us precisely how to solve the equation: with integers (x, y). r 0 x + r y =

6 Example. α = 6/48. 6 = 48 + 3 48 = 3 3 + 9 3 = 9 + 4 9 = 4 + 4 = 4 + 0 The algorithm terminates with an output of:, 3,,, 4. Rebuilding: A 0 = B 0, A = 4 B 3, A = 5 B 4, A 3 = 4 B 3, A 4 = 6 B 4 48 gives the bonus equation 6 48 4 =. Case. α > is irrational. In this case there is no Euclidean algorithm, but we may define: [α] is the round down of α to the nearest integer, and {α} = α [α] is the fractional part of α. Then we get an infinite sequence of natural numbers a 0, a, a,... : α = a 0 + α, letting a 0 = [α] and α = {α} α = a + α, letting a = [α ] and α = {α } α = a + α 3, letting a = [α ] and α 3 = {α } etc. Claim. The sequence of rational numbers {A n /B n } coming from the sequence {a n } converges to the number α that we started with. Proof of Claim. From the definitions above, we have: α = a 0 + = a 0 + α a + = a 0 + α a + = a + α 3 and our polynomial results tell us that: α = f n+(a 0,..., a n, α n+ ) f n (a,..., a n, α n+ ) which, by Corollary, tells us that: α = α n+f n (a 0,..., a n ) + f n (a 0,..., a n ) α n+ f n (a,..., a n ) + f n (a,..., a n ) = α n+a n + A n α n+ B n + B n But it is easy to check that this number is between An B n since this is true for all n, it follows that α is the limit! and A n B n, and

3. Periodic Continued Fractions. A purely periodic continued fraction is associated to a sequence of natural numbers of the form: If we let: then we get: a 0, a,..., a n, a 0, a,..., a n, a 0, a,..., a n,... A n α = lim n B n α = a 0 + a +... + an+ α from which we may conclude, as in the proof of the claim above, that: α = αa n + A n αb n + B n so α is a root of the quadratic equation: B n x + (B n A n )x A n = 0 and one can solve for α with the quadratic formula. Examples. (i) Expansions of the form: a, a, a, a, a,... give α = a + /α so α is a root of the equation x ax = 0 and since α >, we conclude that: α = a + a + 4 (a) When a = we get the golden mean, α = ( + 5)/. (b) When a = k is even, we get α = k + k + so: k, k, k, k,... is the expansion for k + (ii) Expansions of the form: k, k, k, k,... give α which is a root of: 0 = B x +(B 0 A )x A 0 = k(x kx ) and therefore: α = k + 4k + 8 = k + k + Thus it follows that: k, k, k, k, k,... is the expansion of k + 7

8 (iii) Expansions of the form: k,, k,, k,... give α which is a root of x kx k = 0, so: α = k + 4k + 8k = k + k + k and square roots k + k = (k + ) have expansions: (iv) Expansions of the form: k,, k,, k,... k,, k,, k,... give α which is a root of (x kx k) = 0 so: α = k + 4k + 4k = k + k + k and square roots of the form k + k have expansions: k,, k,, k,... Question. Which α > have purely periodic continued fractions? We know each such α is an irrational root of a quadratic equation. Definition. Suppose ax + bx + c = 0 is a quadratic equation, and b 4ac is not a perfect square Then we will say that the roots are a conjugate pair (α, α). Example. (a) If b 4ac < 0, then α, α are complex numbers and they are conjugates in the ordinary sense. (b) The conjugate of the golden mean α = ( + 5)/ is ( 5)/. (c) The conjugate of k (when k is not a perfect square) is k. Theorem. The α > with purely periodic continued fractions: (i) Are irrational numbers, which (ii) Are roots of a quadratic ax + bx + c = 0 with a, b, c Z and (iii) Have a conjugate root α that satisfies < α < 0. Example. Any α of the form: α = k + k + m with 0 < m k is irrational, a root of the quadratic equation: x kx m = 0 and has conjugate root α = k k + m < 0 satisfying < α < 0.

4. Pell s Equation. We seek a solution to an equation of the form: x dy = where d > 0 is a natural number that is not itself a perfect square. Strategy. Such a solution satisfies (x y d)(x + y d) = hence: x y d = x + y d and 0 < x y d = y(x + y d) < y Such good approximations of an irrational ( d) by a rational (x/y) are precisely what continued fraction expansions produce. For example, the continued fraction expansion of 7 is,,,, 4,,,, 4,... and the associated sequence of rational numbers: satisfy, respectively:, 3, 5, 8 3,... 7 = 3 3 7 = 5 7 = 3 8 7 3 = and (8, 3) is a solution to Pell s equation. A more involved example is 3, whose expansion is: producing the sequence: which satisfy: 3,,,,, 6,,,,, 6,... 3, 4, 7, 3, 8 5, 3 3 = 4 4 3 = 3 7 3 = 3 3 3 = 4 8 3 5 = and although (8, 5) only solves x 3y =, we know how to convert that to a solution to Pell s equation by squaring: (8 5 3) = (34 + 5 3) 80 3 = 649 80 3 giving the solution (649, 80). 9

0 Proposition 4. Let: a 0 k, a,..., a n, a 0, a,..., a n,... be the continued fraction expansion of k + m (m k). Then either: (a) n is even, and: or else (b) n is odd, and: A n (k + m) B n = A n (k + m) B n = In the latter case, Pells equation is solved, and in the former: (A n B n k + m) = (A n + (k + m)b n) A n B n k + m solves it with the pair (A n + (k + m)b n, A n B n ). Proof. α = k + k + m has periodic expansion: Let β = k + m. Then: a 0,, a,..., a n, a 0,..., a n,... β = αa n + A n αb n + B n = (β + k)a n + A n (β + k)b n + B n from which it follows that β is a root of the polynomial: B n x (kb n + B n A n )x (ka n + A n ) = 0 But β = k + m, so β is a root of the polynomial: and it follows that: (i) kb n + B n A n = 0 and (ii) ka n + A n = (k + m)b n. x (k + m) = 0 Multiplying (i) through by A n gives us: ka n B n + A n B n A n = 0 and Proposition 3(a) gives us A n B n = A n B n + ( ) n hence: ka n B n +A n B n +( ) n A n = (ka n +A n )B n A n+( ) n = 0 and then (ii) gives: (k + m)b n A n = ( ) n which is exactly what we needed to prove.

Final Remarks. Our examples from 3 give us the following expansions: k + m (k, m) expansion (, ), 3 (, ),, 5 (, ), 4 6 (, ),, 4 7 (, 3) not from the examples 8 (, 4),, 4 0 (3, ) 3, 6 (3, ) 3, 3, 6 (3, 3) 3,, 6 3 (3, 4) not from the examples 4 (3, 5) not from the examples 5 (3, 6) 3,, 6 and while these expansions are predictable, the others are mysterious: () 7 has expansion,,,, 4 () 3 has expansion 3,,,,, 6 (3) 4 has expansion 3,,,, 6 and some really long periods appear for small numbers. For example: 46 has expansion 6,, 3,,,, 6,,,, 3,, leading to an enormous smallest solution to Pell s equation of (4335, 3588).