Use Euclid’s algorithm to find gcd(987, 651).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 987b = 651
gcd(987, 651) =
2.Easy
Find (365·674 + 314) mod 9 without multiplying out the large numbers: reduce first.
n = 9
(365·674 + 314) mod 9 =
3.Medium
Find the inverse of 19 modulo 31: the number x with 0 < x < 31 and 19·x ≡ 1 (mod 31).
a = 19n = 31
19−1 mod 31 =
4.Medium
Find the smallest positive integer x with x ≡ 1 (mod 3) and x ≡ 2 (mod 8).
x ≡ 1 (mod 3)x ≡ 2 (mod 8)
x =
5.Hard
An RSA key uses p = 37, q = 41 and e = 19. Decrypt the ciphertext c = 977: find the message m.
p = 37q = 41e = 19c = 977
m =
6.Hard
Use repeated squaring to find 13175 mod 31.
a = 13k = 175n = 31
13175 mod 31 =
Answer key
- 1. gcd(987, 651) = 21
- 2. (365·674 + 314) mod 9 = 3
- 3. 19−1 mod 31 = 18
- 4. x = 10
- 5. m = 170
- 6. 13175 mod 31 = 26
Full step-by-step solutions: practise this topic on examproblems.com.