• No results found

BASICS OF NUMBER THEORY

Theorem 2.22 If a and b are relatively prime, and if a divides kb for some some integer k, then a must divide k

2.5 The Division Algorithm

LAUNCH

A magician is in possession of a piece of paper on which there is written an integer. He tells you that this integer is being divided by the number 23 and, if you guess what the remainder is, you will win a trip to Las Vegas! He allows you 10 guesses to figure out the remainder. Do you have a good chance of winning the trip? Explain.

Chances are that, when you first read the launch problem, you thought maybe some information was missing. Hopefully, after some exploration and examination of various integer divisions, you began to get an inkling of some of the qualities of their quotients and remainders. Maybe you have even developed some intuitive ideas about the relationship between divisors and remainders in integer division. We will investigate this further now in our discussion of the division algorithm.

Suppose that we divide N = 28 by 4. It goes in 7 times, or put another way, the quotient is 7 and the remainder is 0. When 29 is divided by 4, the quotient is again 7, but the remainder is 1.

When 30 is divided by 4, the quotient is again 7 and the remainder is 2. When 31 is divided by 4, the quotient is again 7 and the remainder is 3. Then everything begins to repeat. 32 divided by 4 gives a quotient of 8 and leaves a remainder of 0 and so on. As we increase N by 1 each time, the quotients get bigger and the remainders cycle, 0, 1, 2, 3, 0, 1, 2, 3. When we divide an integer by 4, there are only 4 possible remainders, and they are, 0, 1, 2 or 3. In a similar manner, when we divide a number by 5, there are 5 possible remainders, 0, 1, 2, 3, and 4. In general, if a number is divided by a positive integer b, there can only be b remainders, and they are 0, 1, 2, . . . b − 1. We learned this in elementary school: When a positive number N is divided by a positive number b, there is a quotient q and a remainder of r. Furthermore, if we multiply the quotient by the divisor and add the remainder, we get N. That is, N = bq + r. We can get an intuitive picture of why this is true by looking on the real number line. There you see b, 2b, 3b, and so on. We can imagine the space between 0 and b to represent a segment of length b, and the space between b and 2b to represent a segment of length b and so on. (Each segment includes the left endpoint but not the right endpoint.) These are back to back and cover the whole number line. It follows that any

number N is either an endpoint of one of these segments or lies inside one of these segments.

What that is essentially saying is that every number N is either a multiple of b, or lies between two multiples of b. If the left part of that segment is the largest multiple of b less than or equal to N, that means that the difference between N and bq is some nonnegative integer, r, less than b. See Figure 2.3 below.

b 2b 3b 4b 5b bq 0

–b ... N

r

(q + 1)b Figure 2.3

From the picture, we can see that N = bq + r . Of course, this diagram alone is not a proof of that fact but is probably convincing to most secondary school students. The real proof is not much different from this intuitive explanation. In fact, the picture we drew and our observations drive the proof. In it, we consider differences between N and multiples of b. Here is the real proof:

Theorem 2.23 (Division Algorithm) If an integer N is divided by a positive integer b, then there is always some integer q0and some remainder r where 0≤ r < b such that N = bq0+ r . Furthermore, q0

and r are unique.

Proof. We give the proof of the case when N and b are both positive, as this makes things just a bit simpler. The theorem is still true when N is negative and b is positive.

So, suppose that N and b are both positive. Consider the set, S, of numbers of the form N− bq, where q = 0, 1, 2, . . . . This set clearly has nonnegative integers since, for example, N is in it. (Just take q = 0.) Now every set of nonnegative integers has a smallest element. Let the smallest element of this set, S, occur when q = q0and call this element r. Thus

N− bq0= r. (2.11)

Since r is the smallest nonnegative integer in this set by choice, r ≥ 0.

We will show that r must be less than b. We will do this by showing that, if r ≥ b, then we can find a smaller nonnegative member of S than that shown in equation 2.11, which will give us our contradiction. Suppose then that r ≥ b then r − b ≥ 0. Consider N − (q0+ 1)b, which is smaller than N− q0b. Here is the proof that N− (q0+ 1)b is nonnegative

N− (q0+ 1)b

= (N− q0b)− b

= r− b ≥ 0. (Since we are assuming r ≥ b.) (2.12)

Since N− (q0+ 1)b is nonnegative, and hence a member of S, and since this number is smaller than the smallest element, (N− q0b), of S, as we have shown, we have our contradiction. Since this contradiction arose from the assumption that r ≥ b, it must follow that r < b.

To prove the uniqueness of q and r, suppose that

N = bq0+ r1 (2.13)

and that

N = bq1+ r2. (2.14)

Our goal is to show that q0= q1 and that r1= r2. Subtracting equation (2.13) from equation (2.14), we get that 0 = b(q1− q0) + r2− r1, which implies that

−b(q1− q0) = r2− r1. (2.15)

Taking the absolute values of both sides of equation (2.15) we get

b(q1− q0)=|r2− r1| . (2.16)

Now, the left side of equation (2.16) is a nonzero multiple of b, if q0= q1, and thus must be greater than, or equal to, b. Since both r1and r2 are between 0 and b, it follows that|r2− r1| is less than b, since this absolute value is the distance between the points. (See Figure 2.4 below.)

0 r1 r2 b

Figure 2.4

So, the left side of equation (2.16) is greater than, or equal to, b if q0= q1and the right side of equation (2.16) is less than b. This is impossible. So q0= q1. Substituting this into equation (2.16), it follows that|r2− r1| = 0, or that r1= r2. 

Notice how much was involved in writing the proof of something that geometrically, using the number line, seemed obvious!

In elementary school, before students learn about rational numbers, they express all of their solutions to division problems in terms of quotients and remainders. Thus, when 16 is divided by 3, the quotient is 5 and the remainder is 1. When they advance to the study of rational numbers they suddenly relinquish all discussion of remainders and express the answer to a division problem, like 16 divided by 3 as 513. What this means in terms of the Division Algorithm is that, instead of N = bq + r , they would write instead, Nb = q +rb. It is important that you as a teacher be aware of this extension from the integers to the rationals.

Theorem 2.23 is a fundamental result about division of integers and has widespread use both in and outside of mathematics. As just one example, when computers process data, every piece of data is changed into strings of digits consisting of 0’s and 1’s. Numbers are stored using their binary representation, which we will talk more about later. However, to get the binary representation of numbers, we need to use the division algorithm. Thus, numerical computations done on computers use the division algorithm in some implicit way! This is neat!

Let us illustrate this theorem.

Example 2.24 Suppose we divide each of the numbers N = 32 and M =−32 by b = 6. Find q and r in each case.

Solution. If we divide N = 32 by b = 6, we get a quotient, q, of 5 and a remainder, r, of 2.

Notice that N = bq + r and that r is between 0 and 6, as the theorem says it should be. When we divide M =−32 by 6, you may think that the quotient, q, is − 5. But if q were, in fact, −5, then

the only way N = bq + r would be if r =−2, and that contradicts the fact that the remainder is between 0 and b. So, instead, we take the quotient to be −6, and then r would be 4, and now M =−32 = 6(−6) + 4 = bq + r where r is between 0 and 6. This is consistent with the proof we gave.

We always find the largest multiple of b less than or equal to N when using the formula N = bq + r , and in the case when N =−32, that largest multiple of 6 less than or equal to −32 is 6(−6). This is very surprising to students and, at first, seems quite strange.

Example 2.25 Suppose that N = 4q + 1. Can we say that the remainder when N is divided by 4 is 1?

Solution. Yes. According to the theorem, there is only one b and one r less than 4 that makes N = bq + r. Since N = 4k + 1 says that b = 4and r = 1 “works” this must be our unique pair of numbers.

So, the remainder when N is divided by 4 must be 1.

Student Learning Opportunities

1 Find the quotient and remainder when each of the following numbers is divided by 5 : (a) 17

(b) −17 (c) 33 (d) −33

2 (C) Suppose that you wished to find the quotient and remainder when 17, 589 is divided by 834. Typically, the calculators students use in secondary schools express non-integer division results using decimals. Your students ask you how they could find the quotient and remainder using such calculators. What do you say?

3 If a natural number a is divided by a natural number b, the quotient is c and the remainder is d. When c is divided by b, the quotient is cand the remainder is d. What is the remainder when a is divided by bb?

4 Use the division algorithm to show that any number N can be written as either N = 3k, N = 3k + 1, or N = 3k + 2. Use this to show that the product of any three consecutive integers must be divisible by 3. (In fact, it must be divisible by 6. Why?)

5 (C) One of your very insightful students checks the squares of several integers and notices that every time the square is divided by 3, it leaves a remainder of 0 or 1. Several other students corroborate this with other examples. How can you use the results of the previous Student Learning Opportunity to show that this is true? Is it true that, if the square of an integer is divided by 4, the remainder can only be 0 or 1? How do you know?

6 (C) A student asks whether there could be any integers that are neither odd or even. How would you prove to your student that every integer must either be odd or even? [Hint: When we defined an even number, we said it was of the form 2m, and an odd number is of the form 2m + 1. It is theoretically possible with this definition that a number is neither odd nor even. That is, there might be numbers that are not picked up by this definition. Using the division algorithm with divisor 2, show that every integer must be odd or even. As a result

of this, it follows that consecutive integers have “opposite parity.” That is, if one is odd, the other is even.]

7 A pair of primes that differ by two is called a twin pair of primes. For example, the pair of numbers 3, 5 is a twin pair.

(a) Find two more twin pairs of primes.

(b) It is unknown if there are infinitely many twin primes. (That is certainly a hard problem to work with if you have the time and inclination.) Let us try a simpler problem. A set of 3 primes, for example, 3, 5, 7 is a prime triple if the differences between the first and second and the second and the third are both two. Using the following hint, show that the set of prime triples is finite: Call the primes in the prime triple, p, p + 2, and p + 4. When p is divided by 3 it leaves a remainder of 0, 1, or 2. That is, p = 3k, 3k + 1, or 3k + 2. If p = 3k, then p divisible by 3. Since the only prime divisible by 3 is 3, we get the triple, 3, 5, 7. Now, show that, if p = 3k + 1, then p + 2 is not prime, and that if

p = 3k + 2, p + 4 is not prime. Thus there is only one prime triple.

(c) Using the same method as in part (a), show that the only prime number p such that p and 8 p2+ 1 are prime is p = 3.