Docsity

Unit 15 1. Powers in mod m arithmetic, Lecture notes of Pre-Calculus

Toggle sidebar
bg1
MATH 13150: Freshman Seminar
Unit 15
1. Powers in mod m arithmetic
In this chapter, we’ll learn an analogous result to Fermat’s theorem. Fermat’s theorem
told us that if pis prime and pdoes not divide a, then there is a number kso that
ak≡1 mod p. In fact, k=p−1 works.
In this result, we’ll see that if mis any number and gcd(a, m) = 1, then there is a
number kso that ak≡1 (mod m). In fact, we can take k=φ(m), where φ(m) is
the Euler function from Unit 10.
We’ll use the result aφ(m)≡1 (mod m) when gcd(a, m) = 1 to compute an(mod m)
for very large numbers of n.
1.1. Some examples. Let’s start by looking at some tables of powers. Here is a
table of powers mod 9. In the table, the entry 7 in the 4-row, 5-column, means that
45≡7 (mod 9).
Mod 9 table of powers, I
n1 2 3 4 5 6 7 8 9 10 11 12
1n1 1 1 1 1 1 1 1 1 1 1 1
2n2 4 8 7 5 1 2 4 8 7 5 1
3n3 0 0 0 0 0 0 0 0 0 0 0
4n4 7 1 4 7 1 4 7 1 4 7 1
5n5 7 8 4 2 1 5 7 8 4 2 1
6n6 0 0 0 0 0 0 0 0 0 0 0
7n7 4 1 7 4 1 7 4 1 7 4 1
8n8 1 8 1 8 1 8 1 8 1 8 1
Let’s make some observations about the table:
1. Once a 1 appears in a column, the pattern leading up to the 1 repeats over and
over. For example, 43≡1 (mod 9), and the first three powers are 4,7,1. The pattern
4,7,1,4,7,1,4,7,1, ... repeats over and over.
2. The rows 1n, 2n, 4n, 5n, 7n, and 8nare quite different from the rows 3nand 6n.
If you think for a moment, you’ll realize that 1,2,4,5,7,8 are the numbers a so that
aand 9 are relatively prime, while 3 and 6 are not relatively prime to 9. Guided by
this, let’s look at a table of Mod 9 powers without including the 3-row and 6-row:
Mod 9 table of powers, II
n1 2 3 4 5 6 7 8 9 10 11 12
1n1 1 1 1 1 1 1 1 1 1 1 1
2n2 4 8 7 5 1 2 4 8 7 5 1
4n4 7 1 4 7 1 4 7 1 4 7 1
5n5 7 8 4 2 1 5 7 8 4 2 1
7n7 4 1 7 4 1 7 4 1 7 4 1
8n8 1 8 1 8 1 8 1 8 1 8 1
Now we can observe that every entry in the 6-column is 1, which means:
1
pf3
pf4
pf5

Partial preview of the text

Download Unit 15 1. Powers in mod m arithmetic and more Lecture notes Pre-Calculus in PDF only on Docsity!

MATH 13150: Freshman Seminar Unit 15

  1. Powers in mod m arithmetic

In this chapter, we’ll learn an analogous result to Fermat’s theorem. Fermat’s theorem told us that if p is prime and p does not divide a, then there is a number k so that ak^ ≡ 1 mod p. In fact, k = p − 1 works. In this result, we’ll see that if m is any number and gcd(a, m) = 1, then there is a number k so that ak^ ≡ 1 (mod m). In fact, we can take k = φ(m), where φ(m) is the Euler function from Unit 10. We’ll use the result aφ(m)^ ≡ 1 (mod m) when gcd(a, m) = 1 to compute an^ (mod m) for very large numbers of n.

1.1. Some examples. Let’s start by looking at some tables of powers. Here is a table of powers mod 9. In the table, the entry 7 in the 4-row, 5-column, means that 45 ≡ 7 (mod 9).

Mod 9 table of powers, I

n 1 2 3 4 5 6 7 8 9 10 11 12 1 n^1 1 1 1 1 1 1 1 1 1 1 2 n^2 4 8 7 5 1 2 4 8 7 5 3 n^3 0 0 0 0 0 0 0 0 0 0 4 n^4 7 1 4 7 1 4 7 1 4 7 5 n^5 7 8 4 2 1 5 7 8 4 2 6 n^6 0 0 0 0 0 0 0 0 0 0 7 n^7 4 1 7 4 1 7 4 1 7 4 8 n^8 1 8 1 8 1 8 1 8 1 8

Let’s make some observations about the table:

  1. Once a 1 appears in a column, the pattern leading up to the 1 repeats over and over. For example, 4^3 ≡ 1 (mod 9), and the first three powers are 4, 7 , 1. The pattern 4 , 7 , 1 , 4 , 7 , 1 , 4 , 7 , 1 , ... repeats over and over.
  2. The rows 1n, 2n, 4n, 5n, 7n, and 8n^ are quite different from the rows 3n^ and 6n. If you think for a moment, you’ll realize that 1, 2 , 4 , 5 , 7 , 8 are the numbers a so that a and 9 are relatively prime, while 3 and 6 are not relatively prime to 9. Guided by this, let’s look at a table of Mod 9 powers without including the 3-row and 6-row:

Mod 9 table of powers, II

n 1 2 3 4 5 6 7 8 9 10 11 12 1 n^1 1 1 1 1 1 1 1 1 1 1 2 n^2 4 8 7 5 1 2 4 8 7 5 4 n^4 7 1 4 7 1 4 7 1 4 7 5 n^5 7 8 4 2 1 5 7 8 4 2 7 n^7 4 1 7 4 1 7 4 1 7 4 8 n^8 1 8 1 8 1 8 1 8 1 8

Now we can observe that every entry in the 6-column is 1, which means: 1

a^6 ≡ 1 (mod 9) provided that gcd(a, 9) = 1. Now let’s look at a table of mod 10 powers. Guided by the example of mod 9 powers, we’ll only look at ak^ (mod 10) when gcd(a, 10) = 1. The mod 10 numbers that are relatively prime to 10 are 1, 3 , 7 , 9, so we’ll only look at ak^ (mod 10) for these values of a.

Mod 10 table of powers

n 1 2 3 4 5 6 7 8 9 10 11 12 1 n^1 1 1 1 1 1 1 1 1 1 1 3 n^3 9 7 1 3 9 7 1 3 9 7 7 n^7 9 3 1 7 9 3 1 7 9 3 9 n^9 1 9 1 9 1 9 1 9 1 9

In this case, we see that a^4 ≡ 1 (mod 10) whenever a is relatively prime to 10, which is another way of saying that the 4-column of the table has all entries equal to 1.

1.2. Euler’s theorem and applications. In this section, we’ll discuss Euler’s the- orem and see how to use it to compute powers. As in Unit 10, φ(m) is the Euler φ-function, which counts numbers from 1 to m that are relatively prime to m.

Theorem 1.1. Let m be a number. Then if a is a number relatively prime to m, aφ(m)^ ≡ 1 (mod m).

Let’s consider a few examples. First, we’ll take m = 9. Then since 9 = 3^2 , φ(9) =

9 ·

= 6, using the formula for computing φ(9) from Unit 10, section 1.3. So if we

let m = 9 in Euler’s theorem, the statement translates as: a^6 ≡ 1 (mod 9) whenever a and 9 are relatively prime. This is exactly what we saw from the Mod 9 table of powers, so Euler’s theorem agrees with what we already knew in this case. Now, let’s try this with m = 10 and see if it agrees with what we know. Since

10 = 2 · 5, φ(10) = 10 ·

= 4. So when m = 10, Euler’s theorem says:

a^4 ≡ 1 (mod 10) when a and 10 are relatively prime. This agrees with the mod 10 table of powers. Finally, let’s consider the case where m = p is a prime number. Then φ(p) = p · p − 1 p

= p − 1, so Euler’s theorem asserts that:

ap−^1 ≡ 1 (mod p) whenever a and p are relatively prime, which is the same as saying that p does not divide a. This means that Euler’s theorem agrees with Fermat’s theorem when m is prime.

This is nice, but for you, the main point is to be able to compute using Euler’s theorem.

EXAMPLE: Compute 7^322 (mod 20).

To do this, we use Euler’s theorem. The first step is to compute φ(20). Since 20 =

22 · 5, φ(20) = 20 ·

= 8. So since 7 and 20 are relatively prime, it follows that:

78 ≡ 1 (mod 20).

132 ≡ 169 ≡ 15 (mod 77), so 134 ≡ 132 · 132 ≡ 15 · 15 ≡ 225 ≡ −6 (mod 77) 138 ≡ 134 · 134 ≡ − 6 · − 6 ≡ 36 (mod 77). Then 1312 ≡ 13 8+4^ ≡ 138 · 134 ≡ 36 · − 6 ≡ − 216 ≡ − 62 ≡ 15 (mod 77), i.e., 1312 ≡ 15 (mod 77), which solves the problem.

PROBLEM: Compute 15^7 (mod 35).

This is a trick question. Since gcd(15, 35) = 5, 15 and 35 are not relatively prime, so we just have to try computing successive squares, as in the beginning of Unit 14. We get: 152 ≡ 225 ≡ 15 (mod 35). 154 ≡ 152 · 152 ≡ 15 · 15 ≡ 152 ≡ 15 (mod 35), which gives: 157 ≡ 15 4+2+1^ ≡ 154 · 152 · 15 ≡ 15 · 15 · 15 ≡ 15 (mod 35), so 157 ≡ 15 (mod 35) is the solution.

1.3. Justification for Euler’s theorem. Euler’s theorem is true for essentially the same reason that Fermat’s theorem is true. To see this, let’s try to justify Euler’s theorem in a mod 18 example. Since 18 = 2 · 32 , φ(18) = 6, and the numbers from 1 to 18 relatively prime to 18 are 1, 5 , 7 , 11 , 13 , 17. We’ll show that 7^6 ≡ 1 (mod 18), as Euler’s theorem predicts, without computing powers. We compute the 7-row for multiplication mod 18 with numbers relatively prime to 18: 7 · 1 ≡ 7 (mod 18) 7 · 5 ≡ 17 (mod 18) 7 · 7 ≡ 13 (mod 18) 7 · 11 ≡ 5 (mod 18) 7 · 13 ≡ 1 (mod 18) 7 · 17 ≡ 11 (mod 18)

It follows that: EQUATION (*): (7 · 1) · (7 · 5) · (7 · 7) · (7 · 11) · (7 · 13) · (7 · 17) ≡ 7 · 17 · 13 · 5 · 1 · 11 (mod 18)

By factoring out the first 7 in each factor in parentheses, the left-hand side of this EQUATION () can be written as: 76 · 1 · · 5 · 7 · 11 · 13 · 17 ≡ 76 · C (mod 18), where C = 1 · 5 · 7 · 11 · 13 · 17. The right-hand side of EQUATION () is C (mod 18), since it has the same factors as C, but in different order. This means we can rewrite EQUATION () as: EQUATION (*): 7^6 · C ≡ C (mod 18). Note that C = 1 · 5 · 7 · 11 · 13 · 17 is relatively prime to 18 since it has no factors

divisible by 2 or 3. Thus,

C

(mod 18) exists, so we can divide by C in EQUATION

(**) to get:

76 · C ·

C

≡ C ·

C

≡ 1 (mod 18), so

76 · 1 ≡ 1 (mod 18) and finally, 76 ≡ 1 (mod 18).

EXERCISES:

(1) Do the following computations in mod 22 arithmetic. Does the last step verify Euler’s theorem? (a) Compute 5^2 (mod 22) (b) Compute 5^4 (mod 22) (c) Compute 5^8 (mod 22) (d) Compute 5^10 (mod 22) (2) Do the following computations in modular arithmetic. (a) Compute 7^8 (mod 30) (b) Compute 11^24 (mod 70). (c) Compute 2^24 (mod 70). (d) Compute 37^80 (mod 300). (e) Compute 5^20 (mod 25). (f) Compute 55^72 (mod 91). (3) Do the following computations in modular arithmetic. (a) Compute 7^13 (mod 30). (b) Compute 3^387 (mod 221). (c) Compute 5^367 (mod 52). (d) Compute 7^1021 (mod 65). (e) Compute 7^563 (mod 44). (4) Explain why 5^6 ≡ 1 (mod 18) following the method used to show that 7^6 ≡ 1 (mod 18) in Section 1.3 of this unit.