Use Euclid’s algorithm to find gcd(423, 396).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 423b = 396
gcd(423, 396) =
2.Easy
Find the least common multiple lcm(259, 175). Use Euclid’s algorithm for the gcd first.
a = 259b = 175
lcm(259, 175) =
3.Medium
Solve 22x ≡ 18 (mod 29). Give the solution x with 0 < x < 29.
22x ≡ 18 (mod 29)
x =
4.Medium
Find the inverse of 21 modulo 94: the number x with 0 < x < 94 and 21·x ≡ 1 (mod 94).
a = 21n = 94
21−1 mod 94 =
5.Hard
An RSA key uses the primes p = 23 and q = 31 and the public exponent e = 7. Find the private exponent d (0 < d < φ(n)).
p = 23q = 31e = 7
d =
6.Hard
Use repeated squaring to find 861 mod 25.
a = 8k = 61n = 25
861 mod 25 =
Answer key
- 1. gcd(423, 396) = 9
- 2. lcm(259, 175) = 6475
- 3. x = 14
- 4. 21−1 mod 94 = 9
- 5. d = 283
- 6. 861 mod 25 = 8
Full step-by-step solutions: practise this topic on examproblems.com.