Find (−22) mod 10, the remainder r with 0 ≤ r < 10.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = −22n = 10
(−22) mod 10 =
2.Easy
Find the least common multiple lcm(392, 272). Use Euclid’s algorithm for the gcd first.
a = 392b = 272
lcm(392, 272) =
3.Medium
Find the inverse of 10 modulo 17: the number x with 0 < x < 17 and 10·x ≡ 1 (mod 17).
a = 10n = 17
10−1 mod 17 =
4.Medium
Find Euler’s totient φ(98), the number of integers from 1 to 98 that are coprime to 98.
n = 98 = 2·72
φ(98) =
5.Hard
Encrypt the message m = 1306 with the RSA public key (n, e) = (1517, 7). Find the ciphertext c.
n = 1517e = 7m = 1306
c =
6.Hard
Use repeated squaring to find 236 mod 93.
a = 2k = 36n = 93
236 mod 93 =
Answer key
- 1. (−22) mod 10 = 8
- 2. lcm(392, 272) = 13328
- 3. 10−1 mod 17 = 12
- 4. φ(98) = 42
- 5. c = 381
- 6. 236 mod 93 = 64
Full step-by-step solutions: practise this topic on examproblems.com.