Use Euclid’s algorithm to find gcd(112, 42).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 112b = 42
gcd(112, 42) =
2.Easy
Find 641² mod 5 without multiplying out the large numbers: reduce first.
n = 5
641² mod 5 =
3.Medium
Find the inverse of 4 modulo 23: the number x with 0 < x < 23 and 4·x ≡ 1 (mod 23).
a = 4n = 23
4−1 mod 23 =
4.Medium
Find the smallest positive integer x with x ≡ 4 (mod 11) and x ≡ 0 (mod 13).
x ≡ 4 (mod 11)x ≡ 0 (mod 13)
x =
5.Hard
An RSA key uses p = 17, q = 47 and e = 7. Decrypt the ciphertext c = 431: find the message m.
p = 17q = 47e = 7c = 431
m =
6.Hard
An RSA key uses the primes p = 5 and q = 43 and the public exponent e = 11. Find the private exponent d (0 < d < φ(n)).
p = 5q = 43e = 11
d =
Answer key
- 1. gcd(112, 42) = 14
- 2. 641² mod 5 = 1
- 3. 4−1 mod 23 = 6
- 4. x = 26
- 5. m = 269
- 6. d = 107
Full step-by-step solutions: practise this topic on examproblems.com.