Find 788 mod 9, the remainder r with 0 ≤ r < 9.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 788n = 9
788 mod 9 =
2.Easy
Use Euclid’s algorithm to find gcd(473, 176).
a = 473b = 176
gcd(473, 176) =
3.Medium
Find the inverse of 45 modulo 59: the number x with 0 < x < 59 and 45·x ≡ 1 (mod 59).
a = 45n = 59
45−1 mod 59 =
4.Medium
Find the inverse of 5 modulo 13: the number x with 0 < x < 13 and 5·x ≡ 1 (mod 13).
a = 5n = 13
5−1 mod 13 =
5.Hard
Use repeated squaring to find 27137 mod 37.
a = 27k = 137n = 37
27137 mod 37 =
6.Hard
An RSA key uses the primes p = 5 and q = 31 and the public exponent e = 7. Find the private exponent d (0 < d < φ(n)).
p = 5q = 31e = 7
d =
Answer key
- 1. 788 mod 9 = 5
- 2. gcd(473, 176) = 11
- 3. 45−1 mod 59 = 21
- 4. 5−1 mod 13 = 8
- 5. 27137 mod 37 = 11
- 6. d = 103
Full step-by-step solutions: practise this topic on examproblems.com.