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

Similar documents
4 Powers of an Element; Cyclic Groups

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

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

5: The Integers (An introduction to Number Theory)

Intermediate Math Circles February 26, 2014 Diophantine Equations I

Recreational Mathematics

4 Number Theory and Cryptography

Basic elements of number theory

Basic elements of number theory

Ch 4.2 Divisibility Properties

2 Elementary number theory

Chapter 5: The Integers

3 The fundamentals: Algorithms, the integers, and matrices

Writing Assignment 2 Student Sample Questions

8 Primes and Modular Arithmetic

Chapter 2. Divisibility. 2.1 Common Divisors

NOTES ON INTEGERS. 1. Integers

0 Sets and Induction. Sets

NOTES ON SIMPLE NUMBER THEORY

The Euclidean Algorithm and Diophantine Equations

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.

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

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

1 Overview and revision

LECTURE NOTES IN CRYPTOGRAPHY

The Euclidean Algorithm and Multiplicative Inverses

Chapter 3: The Euclidean Algorithm and Diophantine. Math 138 Burger California State University, Fresno

a the relation arb is defined if and only if = 2 k, k

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

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

The Euclidean Algorithm

Intermediate Math Circles March 7, 2012 Problem Set: Linear Diophantine Equations II Solutions

Lecture 4: Number theory

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

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

32 Divisibility Theory in Integral Domains

Deepening Mathematics Instruction for Secondary Teachers: Algebraic Structures

Elementary Properties of the Integers

Module 1. Integers, Induction, and Recurrences

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

MATH FINAL EXAM REVIEW HINTS

Chapter 5. Number Theory. 5.1 Base b representations

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

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.

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

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Modular Arithmetic Instructor: Marizza Bailey Name:

An Introduction to Mathematical Thinking: Algebra and Number Systems. William J. Gilbert and Scott A. Vanstone, Prentice Hall, 2005

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

2. THE EUCLIDEAN ALGORITHM More ring essentials

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

Math 2070BC Term 2 Weeks 1 13 Lecture Notes

1. multiplication is commutative and associative;

4. Number Theory (Part 2)

Introduction to Number Theory. The study of the integers

Finitely Generated Modules over a PID, I

Standard forms for writing numbers

Number Theory Notes Spring 2011

With Question/Answer Animations. Chapter 4

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.

Chapter 3 Basic Number Theory

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results

REVIEW Chapter 1 The Real Number System

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

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

MAT 243 Test 2 SOLUTIONS, FORM A

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

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

However another possibility is

Discrete valuation rings. Suppose F is a field. A discrete valuation on F is a function v : F {0} Z such that:

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

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

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?

PRACTICE PROBLEMS: SET 1

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

Rings and modular arithmetic

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

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

1. Factorization Divisibility in Z.

Math Circles - Lesson 2 Linear Diophantine Equations cont.

Mathematical Reasoning & Proofs

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

Properties of the Integers

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

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

Elementary Number Theory

Applied Cryptography and Computer Security CSE 664 Spring 2017

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

Number theory lectures

12x + 18y = 50. 2x + v = 12. (x, v) = (6 + k, 2k), k Z.

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:

2.2 Inverses and GCDs

Contribution of Problems

Some Facts from Number Theory

5.1. Primes, Composites, and Tests for Divisibility

MATH 145 Algebra, Solutions to Assignment 4

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Homework #2 solutions Due: June 15, 2012

is square-free. Suppose it were not and had a square factor x 2 p r 1. This is a contradiction, as the only possible primes dividing p r 1

Number Theory and Group Theoryfor Public-Key Cryptography

Transcription:

Chapter 1 Greatest common divisor 1.1 The division theorem In the beginning, there are the natural numbers 0, 1, 2, 3, 4,..., which constitute the set N. Addition and multiplication are binary operations on N in the sense that the sum and the product of two natural numbers are also natural numbers. The difference of two natural numbers, however, is not necessarily a natural number. If a<bin N, then a b is a negative integer. 1 Neither is division a binary operation in N. In most cases, division of one natural number by another entails a remainder. 1 For the construction of integers from natural numbers, see??.

102 Greatest common divisor Theorem 1.1 (Division theorem). Given nonnegative integers a and b>0, there are unique natural numbers q and r satisfying (i) a = qb + r, (ii) 0 r<b. Proof. (1) Existence part. The sequence of integers, beginning with a, and repeatedly subtracting b, is strictly decreasing: a>a b>a 2b > >a qb >. The numbers will eventually become negative, 2 and there is a natural number q for which a qb 0 and a (q +1)b<0. If we write r = a qb, then since 0 >a (q +1)b =(a qb) b = r b, it follows that r<b. The conditions (i) and (ii) are satisfied. (2) Uniqueness part. Suppose a = q 1 b + r 1 = q 2 b + r 2, with both r 1 and r 2 smaller than b. Ifr 1 and r 2 are unequal, we may assume r 1 >r 2. Then q 1 b<q 2 b and we must have q 1 <q 2. In fact, r 1 r 2 =(q 2 q 1 )b b. This contradicts r 1 r 2 < r 1 < b. Therefore, we must have r 1 = r 2. Consequently, q 1 = q 2. In the division theorem above, q and r are called the quotient and the remainder of the division of a by b. If r =0, then we say that a is divisible by b, and write b a. 2 The fact that there is no strictly decreasing infinite sequence of natural numbers is called the well ordering principle. It is equivalent to the statement that every nonempty set of natural numbers must have a smallest element.

1.1 The division theorem 103 1.1.1 Writing a positive integer in a given base b Let a be a fixed positive integer. Given a positive integer a, by repeated applications of the division theorem, we have This means and we write a = qb + r 0, b = q 1 r 0 + r 1, r 0 = q 2 r 1 + r 2,. r n 2 = q n r n 1 + r n, r n 1 = q n+1 r n. a = r n b n + r n 1 b n 1 + + r 1 b + r 0, a =(r n r n 1 r 1 r 0 ) b and say that this is the base b representation of the integer a. The digits r 0, r 1,...,r n 1, r n are all between 0 and b 1.

104 Greatest common divisor 1.1.2 Calculation of an integer from its base b representation The integer a =(r n r n 1 r 2 r 1 r 0 ) b can be computed efficiently from the following table: r n r n 1 r 2 r 1 r 0 b q n 1 b q 2 b q 1 b qb q n 1 q n 2 q 1 q a

1.1 The division theorem 105 1.1.3 Multiplication of numbers in base a Basic addition and multiplication tables in base 5: + 1 2 3 4 1 2 3 4 10 2 3 4 10 11 3 4 10 11 12 4 10 11 12 13 (43) 5 (24) 5 : 1 2 3 4 1 1 2 3 4 2 2 4 11 13 3 3 11 14 22 4 4 13 22 31 4 3 2 4 3 3 2 1 4 1 2 2 4 2

106 Greatest common divisor 1.2 The euclidean algorithm For natural numbers a and b, the greatest common divisor of a and b is denoted by gcd(a, b). The division theorem allows a drastic simplification of the problem of finding gcd(a, b). Lemma 1.2. Suppose a = qb + r. Then (i) every common divisor of a and b is a common divisor of b and r; (ii) every common divisor of b and r is a common divisor of a and b; consequently, (iii) the common divisors of a and b are exactly the same as the common divisors of b and r, and (iv) gcd(a, b) =gcd(b, r). These observations lead to a straightforward calculation of gcd(a, b): replace the larger number by the remainder and keep on performing division until exact divisibility. To be systematic, we write a = r 1 and b = r 0. r 1 = r 0 q 0 + r 1, 0 r 1 <r 0, r 0 = r 1 q 1 + r 2, 0 r 2 <r 1, r 1 = r 2 q 2 + r 3, 0 r 3 <r 2, r 2 = r 3 q 3 + r 4, 0 r 4 <r 3,. This division process eventually terminates since the remainders are strictly decreasing: r 1 >r 0 >r 1 >r 2 >. In other words, some r n divides the preceding r n 1 (and leaves a remainder r n+1 =0). From these,. r n 2 = r n 1 q n 1 + r n, 0 r n <r n 1, r n 1 = r n q n. gcd(a, b) =gcd(r 1,r 0 )=gcd(r 0,r 1 )= =gcd(r n 2,r n 1 )=gcd(r n 1,r n )=r n.

1.2 The euclidean algorithm 107 Example 1.1. gcd(1876, 365) = 1. r k q k 1876 365 5 51 7 8 6 3 2 2 1 1 2 0

108 Greatest common divisor 1.3 The Bezout identity: gcd(a, b) = ax + by If, along with these divisions, we introduce two more sequences (x k ) and (y k ) with the same rule but specific initial values, namely, x k+1 =x k 1 q k x k, x 1 =1, x 0 =0; y k+1 =y k 1 q k y k, y 1 =0, y 0 =1. then we obtain gcd(a, b) as an integer combination of a and b: 3 gcd(a, b) =r n = ax n + by n. k r k q k x k y k 1 a 1 0 0 b a 0 1 1 a a b b b r 1 x 1 y 1. n 1 r n 1 q n 1 x n 1 y n 1 n r n q n x n y n n +1 0 It can be proved that x n <band y n <a. The relation gcd(a, b) =ax + by for some integers x and y is called the Bezout identity. It is very important, both practically and theoretically. 3 In each of these steps, r k = ax k + by k.

1.3 The Bezout identity: gcd(a, b) =ax + by 109 Exercise Find the gcd of the following pairs of numbers by completing the second column of each table. In each case, express the gcd as an integer combination of the given numbers by completing the last two columns. 1. 2. r k q k x k y k 1876 1 0 365 5 0 1 51 7 8 6 3 2 2 1 1 2 0 r k q k x k y k 11213 1 0 1001 0 1

110 Greatest common divisor 1.4 Solution of linear Diophantine equations Theorem 1.3. Let a, b, c be integers, a and b nonzero. Consider the linear Diophantine equation ax + by = c. (1.1) 1. The equation (1.1) is solvable in integers if and only if d := gcd(a, b) divides c. 2. If this condition is satisfied, a particular solution can be obtained from the Bezout identity. 3. If (x, y) =(x 0,y 0 ) is a particular solution of (1.1), then every integer solution is of the form where t is an integer. x = x 0 + b d t, y = y 0 a d t,

1.4 Solution of linear Diophantine equations 111 Examples 1. Consider the Diophantine equation 3x +4y =5. Since it has a particular solution (x, y) =(3, 1), its general integer solution is (x, y) = (3 4t, 1+3t) for an arbitrary integer t. 2. Somebody received a check, calling for a certain amount of money in dollars and cents. When he went to cash the check, the teller made a mistake and paid him the amount which was written as cents, in dollars, and vice versa. Later, after spending $ 3.50, he suddenly realized that he had twice the amount of the money the check called for. What was the amount on the check? 3. Find the largest possible integer c for which the Diophantine equation 5x +7y = c has exactly three solutions in positive integers. 4. (a) Find the largest positive integer which cannot be written in the form 7x+11y for integers x, y 0. Let S := {7x+11y : x, y nonnegative integers}. Arrange the positive integers in the form 1 8 15 22 29 36 43 50 57 64 71... 2 9 16 23 30 37 44 51 58 65 72... 3 10 17 24 31 38 45 52 59 66 73... 4 11 18 25 32 39 46 53 60 67 74... 5 12 19 26 33 40 47 54 61 68 75... 6 13 20 27 34 41 48 55 62 69 76... 7 14 21 28 35 42 49 56 63 70 77... Observations: (i) Every number in the bottom row, being a positive multiple of 7, is in S. (ii) Among the first 11 columns, along each of the first 6 rows, there is a unique entry (with asterisk) which is a multiple of 11. This entry with asterisk, and those on its right along the row, are in S. (iii) None of the entries on the left of an entry with asterisk is in S. (iv) The entries with asterisks are on different columns. (v) The rightmost entry with an asterisk is 66. From this, the largest integer not in S is 66 7=59. (b) Given relatively prime integers a and b, what is the largest integer which cannot be written as ax + by for nonnegative integers x and y?

112 Greatest common divisor 1.5 Some important consequences of the Bezout identity Theorem 1.4 (Bezout s identity). Given relatively prime integers a>b, there are integers x, y such that ax + by =1. It is possible to choose x and y with x < b and y < a. Corollary 1.5. Let a and b be relatively prime. For every integer c, there is an integer x such that ax c is divisible by b. Proof. Suppose ah + bk =1. Then a(hc) +b(kc) =c and a(hc) c = b(kc) is divisible by b. Corollary 1.6. Let p be a prime number. For every integer a not divisible by p, there exists a positive integer b<psuch that ab 1 is divisible by p.

1.6 Appendix: Construction of integers from natural numbers 113 1.6 Appendix: Construction of integers from natural numbers Let S := N N be the set of ordered pairs of natural numbers. On the set S we define a relation R: (a, b)r(c, d) if and only if a + d = b + c. It is straightforward to verify that R is an equivalence relation, meaning that it is (i) reflexive: (ii) symmetric: and (iii) transitive. Therefore, there is a partition of S into equivalence classes: [a, b] :={(c, d) S :(a, b)r(c, d)}. Each equivalence class (of pairs of natural numbers) is called an integer. The set of integers is denoted by Z. Note that (a, b)r(a b, 0) if a b and (a, b)r(0,b a) if a<b. Therefore, each equivalence class is either [n, 0] or [0,n] for a natural number n. There is a natural inclusion ι : N Z given by ι(n) =[n, 0]. Under ι, weregardn as a subset of Z. In other words, we simply write [n, 0] as n and call this a positive integer if n is nonzero. On the other hand, we write [0,n] as n and call this a negative integer if n is nonzero. The addition and multiplication of integers are induced by the addition of multiplication of natural numbers: (iv) [a 1,b 1 ]+[a 2,b 2 ]=[a 1 + a 2,b 1 + b 2 ], (v) [a 1,b 1 ][a 2,b 2 ]=[a 1 a 2 + b 1 b 2,a 1 b 2 + a 2 b 1 ]. It is necessary to check that these operations do not depend on the choice of representatives. In other words, if [a 1,b 1 ]=[a 1,b 1 ] and [a 2,b 2 ]=[a 2,b 2 ], then for (iv) we must check that [a 1 + a 2,b 1 + b 2 ]=[a 1 + a 2,b 1 + b 2]. This is quite easy: (a 1 + a 2 )+(b 1 + b 2)= (a 1 + b 1)+(a 2 + b 2) = (a 1 + b 1 )+(a 2 + b 2 ) = (a 1 + a 2)+(b 1 + b 2 ). For (v) we must check the more complicated identity [a 1 a 2 + b 1 b 2,a 1 b 2 + a 2 b 1 ]=[a 1a 2 + b 1b 2,a 1b 2 + a 2b 1]. (a 1 a 2 + b 1 b 2 )+(a 1b 2 + a 2b 1)= (a 1 + b 1)(a 2 + b 2) = (a 1 + b 1 )(a 2 + b 2 )