MATH10040 Chapter 1: Integers and divisibility

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

Elementary Properties of the Integers

NOTES ON INTEGERS. 1. Integers

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

Chapter 2. Divisibility. 2.1 Common Divisors

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

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

1 Overview and revision

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

Notes on Systems of Linear Congruences

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

4 Powers of an Element; Cyclic Groups

MATH10040: Chapter 0 Mathematics, Logic and Reasoning

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

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

Lecture 4: Number theory

Cool Results on Primes

Ch 4.2 Divisibility Properties

Chapter 5: The Integers

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

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

NOTES ON SIMPLE NUMBER THEORY

2 Elementary number theory

8 Primes and Modular Arithmetic

Contribution of Problems

1. Factorization Divisibility in Z.

Summary: Divisibility and Factorization

Chapter 1 A Survey of Divisibility 14

Chapter 5. Number Theory. 5.1 Base b representations

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

The Euclidean Algorithm and Multiplicative Inverses

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

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

5: The Integers (An introduction to Number Theory)

1. multiplication is commutative and associative;

PRIME NUMBERS YANKI LEKILI

PRACTICE PROBLEMS: SET 1

1. (a) q = 4, r = 1. (b) q = 0, r = 0. (c) q = 5, r = (a) q = 9, r = 3. (b) q = 15, r = 17. (c) q = 117, r = 11.

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.

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

Divisibility. Chapter Divisors and Residues

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

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

7.2 Applications of Euler s and Fermat s Theorem.

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:

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

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?

Math 109 HW 9 Solutions

1. (a) q = 4, r = 1. (b) q = 0, r = 0. (c) q = 5, r = (a) q = 9, r = 3. (b) q = 15, r = 17. (c) q = 117, r = 11.

Chapter 3 Basic Number Theory

Definition For a set F, a polynomial over F with variable x is of the form

(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.

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

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?

Lecture 7: Polynomial rings

Modular Arithmetic Instructor: Marizza Bailey Name:

Prof. Ila Varma HW 8 Solutions MATH 109. A B, h(i) := g(i n) if i > n. h : Z + f((i + 1)/2) if i is odd, g(i/2) if i is even.

Remainders. We learned how to multiply and divide in elementary

MATH 145 Algebra, Solutions to Assignment 4

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

0 Sets and Induction. Sets

MATH 3330 ABSTRACT ALGEBRA SPRING Definition. A statement is a declarative sentence that is either true or false.

Math 412, Introduction to abstract algebra. Overview of algebra.

1 Continued Fractions

and LCM (a, b, c) LCM ( a, b) LCM ( b, c) LCM ( a, c)

MATH 2400 LECTURE NOTES: POLYNOMIAL AND RATIONAL FUNCTIONS. Contents 1. Polynomial Functions 1 2. Rational Functions 6

CHAPTER 8: EXPLORING R

Mathematical Reasoning & Proofs

CISC-102 Winter 2016 Lecture 11 Greatest Common Divisor

The theory of numbers

As the title suggests, we tackle three famous theorems in this chapter. 4.1 The Fundamental Theorem of Arithmetic

Divisibility = 16, = 9, = 2, = 5. (Negative!)

CHAPTER 4: EXPLORING Z

Number Theory and Graph Theory. Prime numbers and congruences.

Solutions to Assignment 1

Deepening Mathematics Instruction for Secondary Teachers: Algebraic Structures

Elementary Number Theory

Math 511, Algebraic Systems, Fall 2017 July 20, 2017 Edition. Todd Cochrane

MATH FINAL EXAM REVIEW HINTS

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

Proof 1: Using only ch. 6 results. Since gcd(a, b) = 1, we have

Basic elements of number theory

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

Basic elements of number theory

Math 324, Fall 2011 Assignment 7 Solutions. 1 (ab) γ = a γ b γ mod n.

Beautiful Mathematics

Number Theory Solutions Packet

Fall 2017 Test II review problems

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

CHAPTER 3. Number Theory

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

MATH 145 Algebra, Solutions to Assignment 4

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur

Rings If R is a commutative ring, a zero divisor is a nonzero element x such that xy = 0 for some nonzero element y R.

MAS1202/MAS2202 Number Systems and the Foundations of Analysis. Semester 1, 2009/2010

In N we can do addition, but in order to do subtraction we need to extend N to the integers

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

2. Two binary operations (addition, denoted + and multiplication, denoted

Number Theory Math 420 Silverman Exam #1 February 27, 2018

In N we can do addition, but in order to do subtraction we need to extend N to the integers

Transcription:

MATH10040 Chapter 1: Integers and divisibility Recall the basic definition: 1. Divisibilty Definition 1.1. If a, b Z, we say that b divides a, or that a is a multiple of b and we write b a if there is an integer c such that a = bc. Example 1.2. Take a = 75, b = 5. 5 75 since 75 = 5 15. (So in this case c = 15.) Example 1.3. If b is any integer, then b 0 since 0 = b 0. So 0 is divisible by every integer. Example 1.4. If 0 a then a = 0 c for some integer c, and hence a = 0. Thus the only integer divisible by 0 is 0. Example 1.5. An integer is even if and only if it is divisible by 2. It is odd if and only if it is not divisible by 2. 1.1. Elementary properties of divisibility. Lemma 1.6. If a, b Z and if b a then b ta for all integers t. Proof. Since b a there is some integer c with a = bc. Let t Z. Then at = (bc)t = b(ct) is a multiple of b since ct is an integer. Lemma 1.7. If d Z and if d a and d b, then d a + b. Proof. Since d a, a = dm for some m Z. Since d b, b = dn for some n Z. Thus a + b = dm + dn = d(m + n) is a multiple of d, since m + n Z. Lemma 1.8. If d Z and if d a and d b, then d as + bt for any s, t Z. Proof. d as and d bt by Lemma 1.6. Therefore d as + bt by Lemma 1.7. 1.2. The Division Algorithm. Of course, in general, given two integers a and b, it will not be true that b a. Even in primary school we learn how to make the best of this situation: (when a > 0) we find the largest multiple of a which is less than b. The remaining difference is called the remainder 1

2 Example 1.9. Given a = 37 and b = 5. Then 35 = 5 7 is the multiple of 5 which is closest to but not greater than 37. The remainder is 37 35 = 2. We say that 37 leaves remainder 2 on division by 5. Note that our calculation can be summarised as 37 = 5 7 + 2. Dividing across by 5, we can write this as 37 5 = 7 + 2 5. Here, 7 is the largest integer which is not greater than 37/5. It is called the integer part or greatest integer of 37/5. 2/5 is called the fractional part of 37/5. Definition 1.10. Let x be a real number. We denote by x the largest integer which is less than or equal to x. ( x is called the greatest integer of x or the floor of x.) Example 1.11. 1.5 = 1. 37/5 = 7. π = 3. 157 = 157. 1.5 = 2. π = 4. Lemma 1.12. Let x R. (1) Let t = x. Then t x < t + 1. (2) Conversely, if s Z and s x < s + 1 then s = x. Proof. (1) By definition of x, t x. Suppose, for the sake of contradiction, that x t+1. Then t+1 x. But since t Z, t + 1 Z. Since t + 1 > t, this contradicts the fact that t is the largest integer which is less than or equal to x. (2) From the information given, s x while if r is an integer greater than s then r s + 1 > x. Thus s is the largest integer which less than or equal to x; i.e. s = x. The following (very important) theorem just sets down in formal mathematical language something you have known (or at least assumed true) since primary school. We will use it extensively throughout the semester: it is the basis for almost everything which follows.

3 Theorem 1.13 (The Division Algorithm). Let p, q Z with q > 0. Existence There exist integers t, r Z such that p = tq + r and 0 r < q. Uniqueness There is only one pair of integers t and r satisfying the conditions p = tq + r and 0 r < q. Remark 1.14. We say that r is the remainder of p on division by q. (Because of the uniqueness part of the theorem, it makes sense to use the definite article - the - here.) We will sometimes use the notation R q (p) for the remainder of p on division by q. Thus R 5 (27) = 2, R 7 (50) = 1, R 10 (123456) = 6, etc. (This notation is not standard; there is no standard agreed notation for remainders.) Remark 1.15. Of course, if we do not require that 0 r < q, then there are many pairs t, r satisfying the equation p = tq + r: take any integer t and then take r := p tq. The point of the theorem is that there is one and only one solution satisfying the crucial extra condition that 0 r < q. Proof. We first prove the existence part: Existence Let t = p/q. Then t Z, and t p q < t + 1 by our Lemma. Multiply across by q to get Subtracting tq gives tq p < tq + q. 0 p tq < q. Thus, if we let r := p tq then 0 r < q and p = tq + r. Uniqueness Suppose that t, r Z satisfy (1) p = tq + r and 0 r < q. We ll show first that t must be equal to p/q : dividing across by q in (1) gives p q = t + r and 0 r q q < 1.

4 Since 0 r we have p = t + r t. Since r < 1, p = t + r < t + 1. q q q q q q Thus the integer t satisfies t p < t + 1. Thus it is the largest q integer which is less than or p. By definition, it follows that t = p. q q Hence t is determined by p and q. Since r = p qt = p p t, it follows that r is also uniquely q determined by p and q. 2. Greatest Common Divisors 2.1. Example: Water-pouring problems. These problems and their connection with Die Hard 3 will be covered in the lectures. 2.2. Definition and elementary properties. Definition 2.1. Let a, b Z \ {0}. An integer which divides both a and b is called a common divisor. The greatest common divisor of a and b is the largest integer which divides both a and b. We will denote it gcd(a, b), or, more simply when no confusion can arise, (a, b). We begin with the following observation: Lemma 2.2. For any a, b Z \ {0}, (a, b) 1. Proof. Certainly 1 is a common divisor of a and b. So the greatest common divisor is at least as big as 1. For small pairs of numbers, it is easy to calculate the gcd by considering the factors of the smaller number: (6, 15) = 3. (5, 15) = 5. (37, 43) = 1. etc For larger pairs, this is not a feasible or efficient approach. (Try to calculate (1517, 2183).) We will see below that there is a beautifully efficient method for calculating the gcd of two integers a and b without factoring either of them. (This is Euclid s Algorithm.) Definition 2.3. More generally suppose that a 1,..., a t are any t nonzero integers. If d a i for i = 1,..., t we say that d is a common divisor of a 1,..., a t. The largest common divisor of a 1,..., a t is called the greatest common divisor, and is denoted gcd(a 1,..., a t ) or, more simply, (a 1,..., a t ).

Example 2.4. gcd(12, 33, 48) = 3. gcd(14, 49, 21, 56) = 7. Exercise 2.5. Find three nonzero integers a, b, c such that (a, b) > 1, (a, c) > 1 and (b, c) > 1 but (a, b, c) = 1. We will often use the following elementary observation about gcds: Lemma 2.6. Suppose that a, b are nonzero integers and let g = (a, b). Then a/g, b/g Z and ( a g, b ) = 1. g Proof. Since g is a common divisor of a and b there are integers m, n such that a = gm and b = gn; i.e. a/g = m, b/g = n Z. Suppose that d 1 is a common divisor of m and n. So m = ds and n = dt for some integers s and t. It follows that a = (gd)s and b = (gd)t, and hence gd is a common divisor of a and b. Since g is the greatest common divisor of a and b, this implies that d = 1. Corollary 2.7. Let q be a nonzero rational number. Then there exist integers m, n satisfying (m, n) = 1 and q = m/n. Proof. Since q is rational, q = a/b for some nonzero integers a and b. Let g = (a, b). Then there are integers m, n with a = gm, b = gn. By Lemma 2.6, (m, n) = 1. Also q = a b = gm gn = m n. If q is a nonzero rational number and q = m/n with (m, n) = 1, we say that we have written it in reduced form or in lowest terms. Example 2.8. Write the rational number 24/16 in reduced form. Answer: 3/2 (cancel the gcd 8 above and below). Suppose given two nonzero integers a and b. Let us consider the following problem: Which integers can be written as a combination of the form as+bt for some integers s and t? (We will discuss the connection of this question with water-pouring problems in class.) 5

6 The theory of divisors tells us that in general we cannot expect that every integer can be expressed in this way: Recall that if d is a common divisor of a and b then d also divides every integer of the form as + bt. In particular, the greatest common divisor g = (a, b) must divide every integer of the form as + bt. To put this another way: If the integer n is not divisible by (a, b) then it cannot be expressed as as + bt for some integers s, t. Example 2.9. The equation 1849 = 27s+15t has no integer solutions since 3 = (27, 15) and 3 1849. We can express this fact as follows: A necessary condition for the equation n = as + bt to have integer solutions is that (a, b) n. The obvious follow-up question is: Is this condition also sufficient?: If (a, b) n does it follow that there are integers s and t satisfying n = as + bt? Let g = (a, b). A particular case of this last question is: can g be expressed as a combination of a and b; do there exist integers s and t such that g = as + bt? Amazingly, the answer to these questions is yes: Theorem 2.10 (GCD Theorem). Let a, b be nonzero integers. Let g = (a, b). Then there exist integers s and t such that g = as + bt. Proof. We are going to use the well-ordering principle: every nonempty set of positive integers has a least element. First let I be the set of all integers which can be expressed in the form au + bv for some u, v Z; i.e. I := {n Z n = au + bv for some u, v Z}. Note that a I since a = a 1 + b 0. Similarly a = a ( 1) + b 0 I. Similarly ±b I. Let S be the subset of positive integers which belong to I: S := {n I n > 0}. S is non-empty (since, for example, either a S if a > 0 or a S if a < 0). By the well-ordering principle S has a least element. Let s call it h. Since h S I, there exist s, t Z such that h = as+bt. By our discussion above, it follows that g h. Claim: h is a common divisor of a and b. Proof of Claim: We will show that h a. An identical proof shows that h b. By the division algorithm, we can write a = wh + r for some w Z and r satisfying 0 r < h.

However, note that r I, since r = a wh = a w(as + bt) = a (1 ws) + b ( wt), 1 ws, wt Z. However, since r < h and h is the least element of S, it follows that r S; i.e. r 0. Since 0 r it follows that r = 0, and hence a = wh, proving the claim. Since h is a common divisor of a and b, and since g is the greatest common divisor of a and b, it follows that h g. But h > 0 and g h. This implies h = g, and the proof is complete (since h is of the form as + bt). Observe that as a consequence of the proof we have: Corollary 2.11. Let a and b be nonzero integers, and let g = (a, b). Then g is the smallest positive integer which can be written in the form as + bt for some s, t Z. Another corollary of the Theorem is the following: Corollary 2.12. Let a, b be nonzero integers and let d be any common divisor of a and b. Then d (a, b). Proof. Let g = (a, b). Then g = as + bt for some s, t Z by the Theorem. Thus, if d a and d b then d as + bt = g by Lemma 1.8. Hence, not only is the greatest common divisor larger than any other common divisor; it is in fact a multiple of any other common divisor. The theorem also allows us to answer completely the question with which we began this discussion: Corollary 2.13. Let a and b be nonzero integers and let g = (a, b). An integer n can be expressed in the form as + bt with s, t Z if and only if n is a multiple of g. Proof. We have already seen in the discussion above that any integer of the form as + bt is divisible by g. We must prove the converse statement: Suppose that g n. We must show that n = as + bt for some integers s and t. Now g n = n = gm for some m Z. By the GCD Theorem, g = au + bv for some u, v Z. Therefore n = gm = (au + bv)m = a(um) + b(vm) which is of the required form, since s = um, t = vm Z. We will often have occasion to use the following very important special case (when g = 1) of this last corollary: 7

8 Corollary 2.14. Let a and b be nonzero integers and suppose that (a, b) = 1. Then there exist integers s and t satisfying 1 = as + bt. We also make the simple observation that the converse statement is also true: Corollary 2.15. Let a and b be nonzero integers. Then (a, b) = 1 there exist s, t Z with as + bt = 1. Proof. = is just the last result. =: Suppose conversely that there are integers s and t satisfying as+bt = 1. Suppose that d is a common divisor of a and b. Then d as + bt = 1. So d = ±1. Hence (a, b) = 1. Definition 2.16. We say that the nonzero integers a and b are relatively prime if (a, b) = 1. Example 2.17. Are there integers s and t such that the equation 55 = 97s + 61t? Answer: yes! (61, 97) = 1. So any multiple of 1 (i.e. any integer) can be expressed in the form 97s + 61t. In particular, 55 can be expressed in this way. Example 2.18. Are there integers s and t such that 55 = 91s + 63t? Answer: No. (91, 63) = 7 and 7 55. 2.3. Euclid s Algorithm. We know that the equation 55 = 97s + 61t has integer solutions, but how do we find them? There is a very elegant procedure, due to Euclid, which simultaneously finds the gcd, g of two numbers a and b, and finds a solution of the equation g = as + bt. The principle behind this procedure is the following simple result: Lemma 2.19. Let a and b be nonzero integers and suppose that b = am + c for some integers m, c with c 0. Then (a, b) = (a, c). (That is, in calculating the gcd of a and b, we can replace b with c and instead calculate the gcd of a and c). Proof. We simply show that the pairs of integers a, b and a, c have precisely the same common divisors. It follows that they have the same greatest common divisor. Suppose first that d is a common divisor of a and b. Since c = am + b we have d c. Thus d is acommon divisor of a and c.

Conversely, suppose that f is a common divisor of a and c. Since b = am+c, we have f b also and hence f is a common divisor of a and b. In particular, Euclid s algorithm consists of using the following special case over and over again to reduce the size of the numbers involved: Lemma 2.20. Let a and b be positive integers with a < b. Let r be the remainder of b on division by a. Then (a, b) = (a, r). Proof. By the division algorithm, b = ta + r for some integer t. By the last lemma (a, b) = (a, r). We begin with a very elementary example, just to illustrate the method: Example 2.21. Find the greatest common divisor g of 15 and 37. Express g is the form 15s + 37t for some s, t Z. We first divide the smaller into the larger: (2) 37 = 2 15 + 7 By Lemma 2.20, g = (15, 37) = (15, 7) = (7, 15). Divide the smaller into the larger again: (3) 15 = 2 7 + 1 By Lemma 2.20 again, g = (7, 15) = (1, 7) = 1. So far, this tells us what we can see at a glance: (15, 37) = 1. However, we can use the equations (2) and (3) to determine values of s and t such that 15s + 37t = 1: First, start with the last equation equation (3) and use it to express 1 in terms of 7 and 15: (4) 1 = 15 2 7. Then use the previous equation to express 7 in terms of 15 and 37 and substitute this expression for 7 into (4): 1 = 15 2 7 = 15 2 (37 2 15) = 5 15 2 37. So s = 5 and t = 2 are the required integers. Here are some less elementary examples. Example 2.22. Find the greatest common divisor g of the numbers 986 and 437, and find integers s and t satisfying g = 986s + 437t. 9

10 Solution: First we use the division algorithm repeatedly until (our remainder is a common divisor): (5) (6) (7) (8) (9) 986 = 2 437 + 112 437 = 3 112 + 101 112 = 101 + 11 101 = 9 11 + 2 11 = 5 2 + 1 This gives g = (986, 437) = 1. (To spell this out: Using Lemma 2.20 repeatedly (986, 437) = (437, 112) = (112, 101) = (101, 11) = (11, 2) = 1.) Now we bootstrap our way in reverse through the equations to find s and t: 1 = 11 5 2 by (9) = 11 5 (101 9 11) = 46 11 5 101 using (8) = 46 (112 101) 5 101 = 46 112 51 101 using (7) = 46 112 51 (437 3 113) = 199 112 51 437 using (6) = 199 (986 2 437) 51 437 = 199 986 449 437 using (5). Thus s = 199 and t = 437 work. Example 2.23. Find the gcd of 1517 and 2183 and express it as a linear combination of these two numbers. Solution: 2183 = 1517 + 666 1517 = 2 666 + 185 666 = 3 185 + 111 185 = 111 + 74 111 = 74 + 37 Since 37 divides 74 (and hence also 111) we have reached the end of the road, and we can deduce that (2183, 1517) = 37. Finally, 37 = 111 74 = 111 (185 111) = 2 111 185 = 2 (666 3 185) 185 = 2 666 7 185 = 2 666 7 (1517 2 666) = 16 666 7 1517 = 16 (2183 1517) 7 1517 = 16 2183 23 1517.

11 Thus, 37 = 2183s + 1517t where s = 16 and t = 23. Example 2.24. Find a solution of the equation 55 = 97x + 61y in integers x and y. Solution: We use the method suggested by the proof of Corollary 2.13. 97 = 61 + 36 61 = 36 + 25 36 = 25 + 11 25 = 2 11 + 3 11 = 3 3 + 2 3 = 2 + 1 So 1 = 3 2 = 3 (11 3 3) = 4 3 11 = 4 (25 2 11) 11 = 4 25 9 11 = 4 25 9 (36 25) = 13 25 9 36 = 13 (61 36) 9 36 = 13 61 22 36 = 13 61 22 (97 61) = 35 61 22 97. Multiplying across the equation 1 = 35 61 22 97 by 55 gives 55 = (35 55) 61 (22 55) 97 = 1925 61 1210 97. Thus x = 1210 and y = 1925 is a solution.