Find (−22) mod 3, the remainder r with 0 ≤ r < 3.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = −22n = 3
(−22) mod 3 =
2.Easy
Find 897 mod 9, the remainder r with 0 ≤ r < 9.
a = 897n = 9
897 mod 9 =
3.Medium
Find the inverse of 49 modulo 89: the number x with 0 < x < 89 and 49·x ≡ 1 (mod 89).
a = 49n = 89
49−1 mod 89 =
4.Medium
Find the smallest positive integer x with x ≡ 3 (mod 5) and x ≡ 2 (mod 9).
x ≡ 3 (mod 5)x ≡ 2 (mod 9)
x =
5.Hard
59 is prime. Use Fermat’s little theorem to find 1945079 mod 59.
p = 59k = 45079
1945079 mod 59 =
6.Hard
Encrypt the message m = 508 with the RSA public key (n, e) = (1081, 13). Find the ciphertext c.
n = 1081e = 13m = 508
c =
Answer key
- 1. (−22) mod 3 = 2
- 2. 897 mod 9 = 6
- 3. 49−1 mod 89 = 20
- 4. x = 38
- 5. 1945079 mod 59 = 57
- 6. c = 349
Full step-by-step solutions: practise this topic on examproblems.com.