EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972)

Similar documents
5: The Integers (An introduction to Number Theory)

4 Powers of an Element; Cyclic Groups

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

The following is an informal description of Euclid s algorithm for finding the greatest common divisor of a pair of numbers:

The Fundamental Theorem of Arithmetic

2. THE EUCLIDEAN ALGORITHM More ring essentials

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

Chapter 1 A Survey of Divisibility 14

NOTES ON SIMPLE NUMBER THEORY

Chapter 2. Divisibility. 2.1 Common Divisors

Chapter 5: The Integers

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

CISC-102 Winter 2016 Lecture 11 Greatest Common Divisor

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Ch 4.2 Divisibility Properties

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

Chapter 5. Number Theory. 5.1 Base b representations

Elementary Properties of the Integers

The Chinese Remainder Theorem

Greatest Common Divisor MATH Greatest Common Divisor. Benjamin V.C. Collins, James A. Swenson MATH 2730

The Euclidean Algorithm and Multiplicative Inverses

1. Factorization Divisibility in Z.

Divisibility. Chapter Divisors and Residues

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

Chapter 1. Greatest common divisor. 1.1 The division theorem. In the beginning, there are the natural numbers 0, 1, 2, 3, 4,...,

MATH FINAL EXAM REVIEW HINTS

The Euclidean Algorithm

NOTES ON INTEGERS. 1. Integers

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

1 Overview and revision

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

Lecture 4: Number theory

Module 1. Integers, Induction, and Recurrences

Intermediate Math Circles February 26, 2014 Diophantine Equations I

4. Number Theory (Part 2)

(e) Commutativity: a b = b a. (f) Distributivity of times over plus: a (b + c) = a b + a c and (b + c) a = b a + c a.

Divisibility. Def: a divides b (denoted a b) if there exists an integer x such that b = ax. If a divides b we say that a is a divisor of b.

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers:

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

CS250: Discrete Math for Computer Science

Number Theory Notes Spring 2011

1. multiplication is commutative and associative;

Applied Cryptography and Computer Security CSE 664 Spring 2017

Remainders. We learned how to multiply and divide in elementary

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers

Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z:

Introduction to Number Theory. The study of the integers

Math 110 FOUNDATIONS OF THE REAL NUMBER SYSTEM FOR ELEMENTARY AND MIDDLE SCHOOL TEACHERS

Elementary Number Theory

8 Primes and Modular Arithmetic

CISC-102 Fall 2017 Week 6

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

Number theory lectures

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

MATH 361: NUMBER THEORY FOURTH LECTURE

Basic elements of number theory

Basic elements of number theory

Homework 3, solutions

Modular Arithmetic Instructor: Marizza Bailey Name:

Rings and modular arithmetic

Finite Fields. Mike Reiter

Introduction to Abstract Mathematics

2 Elementary number theory

Algebra for error control codes

Basic Algebra. Final Version, August, 2006 For Publication by Birkhäuser Boston Along with a Companion Volume Advanced Algebra In the Series

Deepening Mathematics Instruction for Secondary Teachers: Algebraic Structures

3 The fundamentals: Algorithms, the integers, and matrices

C-N Math 207 Discrete Math

C-N Math 207 Discrete Math

Elementary Number Theory Review. Franz Luef

4 Number Theory and Cryptography

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

a = qb + r where 0 r < b. Proof. We first prove this result under the additional assumption that b > 0 is a natural number. Let

Practice Number Theory Problems

Writing Assignment 2 Student Sample Questions

Math Circles - Lesson 2 Linear Diophantine Equations cont.

Euclidean Domains. Kevin James

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.

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

SEVENTH EDITION and EXPANDED SEVENTH EDITION

Direct Proof Divisibility

Chapter 1 : The language of mathematics.

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

Example: This theorem is the easiest way to test an ideal (or an element) is prime. Z[x] (x)

Beautiful Mathematics

A Readable Introduction to Real Mathematics

#26: Number Theory, Part I: Divisibility

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

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

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

18 Divisibility. and 0 r < d. Lemma Let n,d Z with d 0. If n = qd+r = q d+r with 0 r,r < d, then q = q and r = r.

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

PRIME NUMBERS YANKI LEKILI

MATH 215 Final. M4. For all a, b in Z, a b = b a.

D i v i s i b i l i t y

Quiz 1, Mon CS 2050, Intro Discrete Math for Computer Science

Integers and Division

Transcription:

Intro to Math Reasoning Grinshpan EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972) We all know that every composite natural number is a product of primes. For instance, 36 = 2 2 3 3 1001 = 7 11 13. This fact is easy to believe, and we think of prime numbers as elementary building blocks of which other numbers are made. But here are a couple of questions. If 17 divides the product of two natural numbers, is it true then that 17 divides at least one of the factors? Is it possible to write 978352735632865 as a product of primes in two different ways? The actual numbers are not so important. Can you fully justify your answers to both of these questions? There is a lot of history behind them. Let s take a closer look. 1. Divisors of sums and products. DEFINITION 1. We say that an integer b divides an integer a if there is an integer k such that a = kb. If b divides a, we write b a and call b a divisor of a. Here are some simple consequences drawn from DEFINITION 1. PROPOSITION 1. If c divides both a and b, then c divides a + b and a b. If c divides a and d divides b then cd divides ab. Proof. c a and c b, there exist integers k and m such that a = kc and b = mc. Therefore a + b = (k + m)c and a b = (k m)c, which shows that c divides both a + b and a b. This proves the first assertion. To prove the second assertion, assume that a = kc and b = md for some integers k and m. Then ab = (km)cd, which shows that cd ab. 1. Write DEFINITION 1 using quantifiers. 2. What does b does not divide a mean? Negate the statement b a. 3. Prove that if b a and c b, then c a. 4. Prove that if 6 divides a but not b, then 6 does not divide a + b. 5. Show that if 6 does not divide neither a nor b, it may still divide a + b. 6. Prove that if 6 does not divide a + b, then 6 does not divide a or b. 7. If 6 divides the product of two integers, does it have to divide one of the factors? 8. Let c (a + b) and c (a b). Does it follow that c divides both a and b? 9. Prove that if (a + b) (a 2 + ab + b 2 ), then (a + b) 2 (a 4 + b 4 ).

2. Quotient and remainder How to divide 31 by 7? Take multiples of 7 away from 31, until the nonnegative remainder becomes less than 7 : 31 4 7 = 3. The same process works in general. PROPOSITION 2. Let a be an integer and let b be a positive integer. Then there exists an integer q such that a = bq + r and 0 r < b. Note that r = a bq is, of course, an integer too. We say that q is the quotient and r is the remainder from dividing a by b. Proof. Consider the set of all integers k such that kb a. This set is non-empty and bounded above. Let q be the greatest element of this set. Then 0 a bq < b. 10. What are the quotient and remainder from dividing 23 by 7? 11. Give a geometric proof of PROPOSITION 2. 12. Argue that q and r are uniquely determined. 13. There are 5 creatures. On day 1, some of the creatures subdivide into 5 smaller creatures. On day 2, some of the smaller creatures subdivide into 5 even smaller creatures, and so on. Can this process result in a total of 999 creatures? 14. Find the least integer greater than 99999 that is divisible by 3, 7 and 13. 15. Find the remainder from dividing 98765432123456789 by 4, 8, and 9. 3. Greatest common divisor Let a and b be integers, not both zero. Among all integers k that divide both a and b choose the greatest. This is possible, since a and b have finitely many common divisors. DEFINITION 2. The greatest integer that divides both a and b is called the greatest common divisor of a and b, denoted by GCD(a, b). If GCD(a, b)=1, then a and b are called coprime. EXAMPLES. GCD(0, 10) = 10, GCD(12, 18) = 6, GCD(21, 91) = 7, GCD(3, 4) = 1. 16. If ab = 600, how large can GCD(a, b) be? 17. Prove that if d =GCD(a, b), a = kd, and b = md, then k and m are coprime. 18. Consider the segment with endpoints (15, 0) and (0, 6). It contains 4 points with integer coordinates. How many points with integer coordinates lie on the segment with endpoints (n, 0) and (0, m)? 19. How many pairs x, y of natural numbers with 3x + 5y = 15 are there? 20. Let m and n be natural numbers. How many pairs x, y of natural numbers with mx + ny = mn are there? To find the greatest common divisor of two numbers we could, in principle, list all of their common divisors and then choose the greatest. But this approach would be troublesome if the numbers are large. After all, we may not be looking for the complete list of common divisors. Shouldn t there be another way? 2

Let us make an important observation. 4. Euclid s Algorithm LEMMA 1. Let a = bq + r, where a, b, q, and r are integers. Then the pair a, b has the same set of common divisors as the pair b, r. In particular, GCD(a, b) =GCD(b, r). Proof. Let d be a common divisor of a and b. Then, by PROPOSITION 1, d divides bq, and so d divides a bq = r. Hence d is a common divisor of b and r. Now let d be a common divisor of b and r. Then, by PROPOSITION 1, d divides bq, and so d divides bq + r = a. Hence d is a common divisor of a and b. We infer that a, b and b, r have the same set of common divisors, as desired. LEMMA 1 gives us a much better method of finding GCD. EXAMPLE. What is the greatest common divisor of 6069 and 663? We have 6069 = 663 9 + 102, so GCD(6069, 663) =GCD(663, 102). Next write 669 = 102 6 + 51, so GCD(663, 102) =GCD(102, 51). But 102 is a multiple of 51 and GCD(102, 51) = 51. Hence the answer is 51. This method is known as the Euclidean algorithm. It dates back to at least 300 BC. The idea is to iterate PROPOSITION 2. Let a and b be two given integers. Assume for definiteness that a > b > 0. The first step is to write a = bq + r, where q, r are integers and b > r 0. If r = 0, then GCD(a, b) = b, stop. Otherwise, divide b by r 1 : b = q 1 r + r 1, where q 1, r 1 are integers and r > r 1 0. If r 1 = 0, then GCD(a, b) =GCD(b, r) = r, stop. Otherwise, continue: r = q 2 r 1 + r 2, where q 2, r 2 are integers and r 1 > r 2 0. The process will terminate sooner or later, as the remainders are nonnegative and decreasing: r 1 > r 2 > > r n > r n+1 = 0. The very last step will give r n 1 = q n+1 r n + 0. The smallest positive remainder r n =GCD(r n, 0) is GCD(a, b). 21. Find the greatest common divisor of 987654321 and 123456789. 22. Find the greatest common divisor of 7777777777 and 777777. 23. Find a geometric interpretation of the Euclidean algorithm. 24. Give a bound on the number of steps of the Euclidean algorithm. 25. How many steps are needed if a = f n+1, b = f n are two successive Fibonacci numbers? 3

5. Linear equations Euclid s algorithm reveals a deeper property of the greatest common divisor. LEMMA 2. If d =GCD(a, b), then there exist integers m and n such that d = ma + nb. Proof. Let us retrace the steps of the algorithm. We have r = a bq r 1 = b rq 1 = aq 1 + b(1 + qq 1 ) r 2 = r r 1 q 2 = (1 + q 1 q 2 )a + ( q q 2 qq 1 q 2 )b... Observe that the remainder after each step can be written as r k = a integer + b integer. In particular, this is true for r n = d, which proves the lemma. To find m and n we could run the steps backwards. EXAMPLE. Find integers m and n such that 51 = 6069m + 663n. We have 51 = 663 102 6 = 663 (6069 663 9) 6 so m = 6, n = 55. = ( 6) 6069 + 55 663, The following consequence of LEMMA 2 is, in fact, equivalent to it. COROLLARY. If a and b are coprime, then there exist integers m and n such that 1 = am + bn. 26. Find two integers m and n with 85m + 204n = 17. 27. Are there any integers m, n such that 105m + 56n = 42? 28. Are there any integers m, n such that 104m + 65n = 43? 29. Prove that a/gcd(a, b) and b/gcd(a, b) are coprime. REMARK. Actually, GCD(a, b) is the smallest positive integer that can be written in the form am + bn. The equation ax + by = c is solvable (over integers) only if GCD(a, b) divides c. If c is a multiple of d = GCD(a, b), then ax + by = c has infinitely many integer solutions and they are x = mk + b 1 j, y = nk a 1 j, where a 1 = a/d, b 1 = b/d, k = c/d, am + bn = d, and j runs over integers. 4

6. The Fundamental Theorem of Arithmetic To prove the fundamental theorem we will need one more auxiliary step. LEMMA 3. If c divides ab and if b and c are coprime, then c divides a. Proof. Since GCD(b, c) = 1, then by LEMMA 2 there exist integers m and n such that bm + cn = 1. Multiplying the equation by a we obtain abm + acn = a. Observe that c divides abm and acn. Hence c divides their sum a. 30. Prove that if b a, c a, and GCD(b, c) = 1, then bc a. 31. If 60 ab and GCD(b, 10) = 1, is it true that 20 a? DEFINITION 3. A natural number p is called prime if it has exactly two positive divisors: 1 and p. Since 1 has just one positive divisor, it is not prime. If p is prime, then for any integer a there are two mutually exclusive possibilities: either p divides a (if their GCD is p) or a and p are coprime (if their GCD is 1). By LEMMA 3, if a prime p divides ab, then p divides at least one of the factors. THEOREM. Every natural number greater than 1 can be written as a product of primes. The factorization is unique up to the order of terms. This is the Fundamental Theorem of Arithmetic. Proof. Select any natural number greater than 1. If it is prime, there is nothing to prove. Otherwise, it is a product of two integer factors greater than 1. Each factor that is not prime is, in turn, a product of two integer factors greater than 1. Continue the process. Because each factor is less than a whole, the process will terminate after finitely many steps. The result: a factorization into primes. We now prove the uniqueness part. Suppose that p 1 p 2 p 3... p n = q 1 q 2 q 3... q m for some prime numbers p i and q i. Since p 1 divides the left side, it also divides the right side. Hence p 1 must divide one of the factors q i, say q 1. But q 1 is prime, so q 1 = p 1. Divide both sides of the equation by p 1, p 2 p 3... p n = q 2 q 3... q m, and examine p 2 next. Since p 2 divides the left side, it also divides the right side. Hence p 2 must divide one of the remaining factors q i, say q 2. But q 2 is prime, so q 2 = p 2. Divide both sides of the equation by p 2, p 3... p n = q 3... q m, and continue the process. After n steps, the left side will reduce to 1. Hence the right side will also reduce to 1, implying that m = n. Thus p i = q i for each 1 i m. 5

32. Factorize 2013 into primes. 33. If m, n are coprime and am = bn, then a = kn and b = km for some integer k. 34. If m, n are coprime and a m = b n, then a = c n and b = c m for some integer c. 6