Find (−108) mod 7, the remainder r with 0 ≤ r < 7.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = −108n = 7
(−108) mod 7 =
2.Easy
Find 171² mod 6 without multiplying out the large numbers: reduce first.
n = 6
171² mod 6 =
3.Medium
Find the inverse of 47 modulo 61: the number x with 0 < x < 61 and 47·x ≡ 1 (mod 61).
a = 47n = 61
47−1 mod 61 =
4.Medium
Find the inverse of 9 modulo 11: the number x with 0 < x < 11 and 9·x ≡ 1 (mod 11).
a = 9n = 11
9−1 mod 11 =
5.Hard
97 is prime. Use Fermat’s little theorem to find 2969560 mod 97.
p = 97k = 69560
2969560 mod 97 =
6.Hard
Encrypt the message m = 677 with the RSA public key (n, e) = (1189, 23). Find the ciphertext c.
n = 1189e = 23m = 677
c =
Answer key
- 1. (−108) mod 7 = 4
- 2. 171² mod 6 = 3
- 3. 47−1 mod 61 = 13
- 4. 9−1 mod 11 = 5
- 5. 2969560 mod 97 = 91
- 6. c = 446
Full step-by-step solutions: practise this topic on examproblems.com.