Use Euclid’s algorithm to find gcd(98, 26).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 98b = 26
gcd(98, 26) =
2.Easy
Find 151 mod 8, the remainder r with 0 ≤ r < 8.
a = 151n = 8
151 mod 8 =
3.Medium
Find the inverse of 35 modulo 39: the number x with 0 < x < 39 and 35·x ≡ 1 (mod 39).
a = 35n = 39
35−1 mod 39 =
4.Medium
Find the inverse of 23 modulo 29: the number x with 0 < x < 29 and 23·x ≡ 1 (mod 29).
a = 23n = 29
23−1 mod 29 =
5.Hard
An RSA key uses p = 11, q = 23 and e = 7. Decrypt the ciphertext c = 21: find the message m.
p = 11q = 23e = 7c = 21
m =
6.Hard
Encrypt the message m = 718 with the RSA public key (n, e) = (1081, 3). Find the ciphertext c.
n = 1081e = 3m = 718
c =
Answer key
- 1. gcd(98, 26) = 2
- 2. 151 mod 8 = 7
- 3. 35−1 mod 39 = 29
- 4. 23−1 mod 29 = 24
- 5. m = 43
- 6. c = 1022
Full step-by-step solutions: practise this topic on examproblems.com.