Use Euclid’s algorithm to find gcd(1008, 414).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 1008b = 414
gcd(1008, 414) =
2.Easy
Use Euclid’s algorithm to find gcd(840, 792).
a = 840b = 792
gcd(840, 792) =
3.Medium
Find Euler’s totient φ(24), the number of integers from 1 to 24 that are coprime to 24.
n = 24 = 23·3
φ(24) =
4.Medium
Find the inverse of 9 modulo 41: the number x with 0 < x < 41 and 9·x ≡ 1 (mod 41).
a = 9n = 41
9−1 mod 41 =
5.Hard
An RSA key uses p = 31, q = 43 and e = 13. Decrypt the ciphertext c = 815: find the message m.
p = 31q = 43e = 13c = 815
m =
6.Hard
An RSA key uses p = 11, q = 41 and e = 7. Decrypt the ciphertext c = 49: find the message m.
p = 11q = 41e = 7c = 49
m =
Answer key
- 1. gcd(1008, 414) = 18
- 2. gcd(840, 792) = 24
- 3. φ(24) = 8
- 4. 9−1 mod 41 = 32
- 5. m = 537
- 6. m = 389
Full step-by-step solutions: practise this topic on examproblems.com.