Find (−80) mod 7, the remainder r with 0 ≤ r < 7.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = −80n = 7
(−80) mod 7 =
2.Easy
Use Euclid’s algorithm to find gcd(318, 294).
a = 318b = 294
gcd(318, 294) =
3.Medium
Find the inverse of 7 modulo 39: the number x with 0 < x < 39 and 7·x ≡ 1 (mod 39).
a = 7n = 39
7−1 mod 39 =
4.Medium
Find the inverse of 42 modulo 47: the number x with 0 < x < 47 and 42·x ≡ 1 (mod 47).
a = 42n = 47
42−1 mod 47 =
5.Hard
19 is prime. Use Fermat’s little theorem to find 1847169 mod 19.
p = 19k = 47169
1847169 mod 19 =
6.Hard
How many solutions N does 18x ≡ 10 (mod 50) have in {0, 1, …, 49}?
18x ≡ 10 (mod 50)
N =
Answer key
- 1. (−80) mod 7 = 4
- 2. gcd(318, 294) = 6
- 3. 7−1 mod 39 = 28
- 4. 42−1 mod 47 = 28
- 5. 1847169 mod 19 = 18
- 6. N = 2
Full step-by-step solutions: practise this topic on examproblems.com.