Вы находитесь на странице: 1из 5

MATH 13150: Freshman Seminar

Unit 15

1. Powers in mod m arithmetic


In this chapter, well learn an analogous result to Fermats theorem. Fermats 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, well 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.
Well 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. Lets 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).
n
1n
2n
3n
Mod 9 table of powers, I 4n
5n
6n
7n
8n

1
1
2
3
4
5
6
7
8

2
1
4
0
7
7
0
4
1

3
1
8
0
1
8
0
1
8

4
1
7
0
4
4
0
7
1

5
1
5
0
7
2
0
4
8

6
1
1
0
1
1
0
1
1

7
1
2
0
4
5
0
7
8

8
1
4
0
7
7
0
4
1

9 10 11 12
1 1 1 1
8 7 5 1
0 0 0 0
1 4 7 1
8 4 2 1
0 0 0 0
1 7 4 1
8 1 8 1

Lets 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 8n are quite different from the rows 3n and 6n .
If you think for a moment, youll 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, lets look at a table of Mod 9 powers without including the 3-row and 6-row:
n
1n
2n
Mod 9 table of powers, II 4n
5n
7n
8n

1
1
2
4
5
7
8

2
1
4
7
7
4
1

3
1
8
1
8
1
8

4
1
7
4
4
7
1

5
1
5
7
2
4
8

6
1
1
1
1
1
1

7
1
2
4
5
7
8

8
1
4
7
7
4
1

9 10 11 12
1 1 1 1
8 7 5 1
1 4 7 1
8 4 2 1
1 7 4 1
8 1 8 1

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

a6 1 (mod 9) provided that gcd(a, 9) = 1.


Now lets look at a table of mod 10 powers. Guided by the example of mod 9 powers,
well 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 well only look at ak (mod 10) for these values
of a.
n 1 2 3 4 5 6 7 8 9 10 11 12
1n 1 1 1 1 1 1 1 1 1 1 1 1
Mod 10 table of powers 3n 3 9 7 1 3 9 7 1 3 9 7 1
7n 7 9 3 1 7 9 3 1 7 9 3 1
9n 9 1 9 1 9 1 9 1 9 1 9 1
In this case, we see that a4 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. Eulers theorem and applications. In this section, well discuss Eulers theorem 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).
Lets consider a few examples. First, well take m = 9. Then since 9 = 32 , (9) =
2
9 = 6, using the formula for computing (9) from Unit 10, section 1.3. So if we
3
let m = 9 in Eulers theorem, the statement translates as:
a6 1 (mod 9) whenever a and 9 are relatively prime. This is exactly what we saw
from the Mod 9 table of powers, so Eulers theorem agrees with what we already
knew in this case.
Now, lets try this with m = 10 and see if it agrees with what we know. Since
1 4
10 = 2 5, (10) = 10 = 4. So when m = 10, Eulers theorem says:
2 5
a4 1 (mod 10) when a and 10 are relatively prime. This agrees with the mod 10
table of powers.
Finally, lets consider the case where m = p is a prime number. Then (p) = p
p1
= p 1, so Eulers theorem asserts that:
p
ap1 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 Eulers theorem agrees with Fermats
theorem when m is prime.
This is nice, but for you, the main point is to be able to compute using Eulers
theorem.
EXAMPLE: Compute 7322 (mod 20).
To do this, we use Eulers theorem. The first step is to compute (20). Since 20 =
1 4
22 5, (20) = 20 = 8. So since 7 and 20 are relatively prime, it follows that:
2 5
78 1 (mod 20).

Now divide 8 into 322, it goes in 40 times with remainder 2, so 322 = 40 8 + 2. It


follows that:
7322 7840+2 (78 )40 72 140 72 (mod 20), using rules of expondents and Eulers
theorem. But
But 140 72 72 49 9 (mod 20), so putting this together, we conclude that
7322 9 (mod 20).
Remark 1.2. Another way of writing out the solution is to say that since 322 2
(mod 8), it follows that
7322 72 (mod 20).
In other words, the 40 in 322 = 40 8 + 2 is not essential, because it just comes in as
a power of 1: 140 1 (mod 20).
GENERAL RULE: If k r (mod (m)), then ak ar (mod m).
We can justify this rule, following what we did in the last problem. If k r
(mod (m)), then k = s (m) + r for some number s. But then:
ak as(m)+r as(m) ar (mod m), so
ak (a(m) )s ar 1s ar ar (mod m), since a(m) 1 (mod m).
PROBLEM: Compute 12268 (mod 35).
To solve this, we first check that 12 and 35 are relatively prime, so we can use Eulers
4 6
theorem. Then we compute (35) = 35 = 24. Now divide 24 into 268, and we
5 7
find 268 4 (mod 24), since 264 = 11 24 + 4. From this, we can deduce using the
GENERAL RULE from the last remark that:
12268 124 (mod 35).
It remains to compute 124 (mod 35). You can either do that using a calculator, or
compute 122 144 4 (mod 35), so
124 122 122 4 4 16 (mod 35), so
12268 16 (mod 35) solves the problem.
PROBLEM: Compute 71688 (mod 180).
To solve this problem, first check that 7 and 180 are relatively prime, which is easy
1 2 4
since 180 = 22 32 5. Thus, (180) = 180 = 48. Now divide 48 into 1688,
2 3 5
to find 1688 = 48 35 + 8, so 1688 8 (mod 48). Using the GENERAL RULE from
Remark 1.2, we find:
71688 78 (mod 180). Its no fun trying to compute 78 (mod 180) without a calculator, but with a calculator you can see easily that:
78 5764801 121 (mod 180). From this, we conclude that
71688 121 (mod 180), which solves the problem.
PROBLEM: Compute 13732 (mod 77).
Since 77 = 711, 77 and 13 are relatively prime, and (77) = 60. A quick computation
gives 732 12 (mod 60), so
13732 1312 (mod 77), so we just need to compute 1312 (mod 77), which we can do
using successive squares. This gives:

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 138+4 138 134 36 6 216 62 15 (mod 77), i.e.,
1312 15 (mod 77), which solves the problem.
PROBLEM: Compute 157 (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 154+2+1 154 152 15 15 15 15 15 (mod 35), so
157 15 (mod 35) is the solution.
1.3. Justification for Eulers theorem. Eulers theorem is true for essentially the
same reason that Fermats theorem is true. To see this, lets try to justify Eulers
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. Well show that 76 1 (mod 18),
as Eulers 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 (**): 76 C C (mod 18).
Note that C = 1 5 7 11 13 17 is relatively prime to 18 since it has no factors
1
(mod 18) exists, so we can divide by C in EQUATION
divisible by 2 or 3. Thus,
C
(**) to get:
1
1
76 C C 1 (mod 18), so
C
C

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
Eulers theorem?
(a) Compute 52 (mod 22)
(b) Compute 54 (mod 22)
(c) Compute 58 (mod 22)
(d) Compute 510 (mod 22)
(2) Do the following computations in modular arithmetic.
(a) Compute 78 (mod 30)
(b) Compute 1124 (mod 70).
(c) Compute 224 (mod 70).
(d) Compute 3780 (mod 300).
(e) Compute 520 (mod 25).
(f) Compute 5572 (mod 91).
(3) Do the following computations in modular arithmetic.
(a) Compute 713 (mod 30).
(b) Compute 3387 (mod 221).
(c) Compute 5367 (mod 52).
(d) Compute 71021 (mod 65).
(e) Compute 7563 (mod 44).
(4) Explain why 56 1 (mod 18) following the method used to show that 76 1
(mod 18) in Section 1.3 of this unit.

Вам также может понравиться