Find (−145) mod 7, the remainder r with 0 ≤ r < 7.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = −145n = 7
(−145) mod 7 =
2.Easy
Use Euclid’s algorithm to find gcd(384, 84).
a = 384b = 84
gcd(384, 84) =
3.Medium
Find Euler’s totient φ(27), the number of integers from 1 to 27 that are coprime to 27.
n = 27 = 33
φ(27) =
4.Medium
Solve 41x ≡ 67 (mod 95). Give the solution x with 0 < x < 95.
41x ≡ 67 (mod 95)
x =
5.Hard
Use repeated squaring to find 3975 mod 50.
a = 39k = 75n = 50
3975 mod 50 =
6.Hard
An RSA key uses p = 5, q = 11 and e = 3. Decrypt the ciphertext c = 14: find the message m.
p = 5q = 11e = 3c = 14
m =
Answer key
- 1. (−145) mod 7 = 2
- 2. gcd(384, 84) = 12
- 3. φ(27) = 18
- 4. x = 92
- 5. 3975 mod 50 = 49
- 6. m = 9
Full step-by-step solutions: practise this topic on examproblems.com.