Professional Documents
Culture Documents
Activity:
We can verify that 25 13 (mod 6). Now:
1) Add the same integer to both sides of the congruence (mod 6). Does congruence
(mod 6) still apply? You can write your answer below.
2) Subtract the same integer from both sides of the congruence (mod 6). Does
congruence (mod 6) still apply? You can write your answer below.
3) Multiply the same integer to both sides of the congruence (mod 6). Does
congruence (mod 6) still apply? You can write your answer below.
Theorem. If a, b, c, and n are integers with n > 1, such that a b (mod n), then:
a) a + c b + c (mod n)
b) a – c b – c (mod n)
c) a c b c (mod n)
Proof. The proof of (a) will be shown here. The proofs of (b) and (c) will be left as an
exercise.
Theorem. If ac bc (mod n), and c and n are relatively prime, then a b (mod n).
Proof. Since ac bc (mod n), then n|(ac – bc). Equivalently n|c(a – b). But since n
and c are relatively prime (i.e., they do not share a common divisor), then n must
divide (a – b). This implies that a b (mod n).
c d (mod 4).
1) Add c to the left side, and d to the right side of the equation below. Does
congruence (mod 4) still apply? You can write your answer below.
Theorem. If a, b, c, d and n are integers with n > 1, such that a b (mod n) and c
d (mod n), then:
a) a + c b + d (mod n)
b) a – c b – d (mod n)
c) a c b d (mod n)
Proof. We will prove (a). The proofs of the others are left as exercises.
It is given that a b (mod n) and c d (mod n). Therefore, there exist integers r and s
such that (a – b) = nr and (c – d) = ns.
Now, consider (a + c) – (b + d). Is this divisible by n also? We will find out.
Observe that (a + c) – (b + d) = (a – b) + (c – d). [if we simplify, these are the same]
= nr + ns = n(r + s)
Fast Exponentiation
Theorem. If a, b, k, and n are integers with k > 0 and m > 1, such that a b (mod
n), then
ak bk (mod n).
Proof. It is given that a b (mod n), which means that n|(a – b). We need to
prove that n|(ak – bk).
If we factor ak – bk, we will get:
ak – bk = (a – b)(ak – 1 + ak – 2b + … + abk – 2 + bk – 1)
Thus, (a – b) is a divisor of ak – bk, or (a – b)|(ak – bk). Together with the fact
that n|(a – b), then n|(ak – bk).
Example. Compute the least positive residues of 2, 22, 24, 28, 216, … 2512
(mod 645) by applying the previous theorem (i.e., square both sides of the
congruence repeatedly).
Solution. Since we are dealing with mod 645, then the least positive residues
can be any integer from 0 to 644.
[raising to a power]
If a, b, k, and n are integers with k > 0 and m > 1, such that a b (mod n), then
ak bk (mod n).
Problem Set
1. Prove: If a is an even integer, then a2 0 (mod 4). Hint: Start with defining a
= 2k where k is an integer.
2. Prove: If a is an odd integer, then a2 1 (mod 4).
3. Prove: If a is an odd integer, then a2 1 (mod 8). Hint: This is similar to the
previous problem. You would need an additional step here, where you will use
the fact that if there are 2 consecutive integers such as k and k + 1, then one
of them must be odd and one must be even.
4. Prove: If a, b, c, d and n are integers with n > 1, such that a b (mod n) and c d
(mod n), then a – c b – d (mod n).
Answer key:
6) 3, 9, 81, 291, 245, 251, 301, 313, 157, 405
7) 67 8) 21 9) 625 10) All answers from (a) to (d) are
the same… Then use letters/variables to try to generalize into a conjecture;
11) You should notice something similar in your answers in (a) to (d). Then
use letters/variables to try to generalize into a conjecture.
Let d = gcd(a, n). If c is one solution, then all solutions are of the form c +
k(n/d), where k is any integer.
The proof is beyond the scope of this module.
Example Solve 4x 6 (mod 8).
Solution. Based on the theorem above, first compute d = gcd(4,8) = 4. Note
that 4 does not divide 6. Therefore, the equation has no solution.
Example. Solve (a) 24x 1 (mod 37), and (b) 24x 5 (mod 37)
Solution. (a) Since d = gcd(24, 37) = 1 and 1|1, then there is a solution.
However it is very tedious to check all integers from 0 through 36. We will now
employ another strategy: The Euclidean Algorithm.
Let us apply the Euclidean Algorithm for 24 and 37 as follows.
Thus, we’ve found [and you can verify using a calculator] that
1 = 17(24) – 11(37)
This is a multiple
of 37, and so it is
0 (mod 37)
Therefore 24(17) 1 (mod 37), and we have solved equation (a): x = 17.
To solve part (b), we can use part (a) by multiplying both sides by 5.
24(17) 1 (mod 37) → 24(17)(5) 5 (mod 37)
→ 24(85) 5 (mod 37)
Problem Set
Answer key:
1) 10 + 11k where k is an integer; 2) no solution; 3) 4 + 5k where k is an
integer; 4) 6 + 9k where k is an integer; 5) 19 + 21k where k is an integer; 6) 4
+ 29k where k is an integer; 7) 10, 34, 58; 8) 23 + 65k where k is an integer