Use Euclid’s algorithm to find gcd(624, 516).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 624b = 516
gcd(624, 516) =
2.Easy
Use Euclid’s algorithm to find gcd(236, 16).
a = 236b = 16
gcd(236, 16) =
3.Medium
Find the inverse of 38 modulo 47: the number x with 0 < x < 47 and 38·x ≡ 1 (mod 47).
a = 38n = 47
38−1 mod 47 =
4.Medium
Find Euler’s totient φ(49), the number of integers from 1 to 49 that are coprime to 49.
n = 49 = 72
φ(49) =
5.Hard
Use repeated squaring to find 4347 mod 64.
a = 43k = 47n = 64
4347 mod 64 =
6.Hard
An RSA key uses p = 31, q = 37 and e = 7. Decrypt the ciphertext c = 308: find the message m.
p = 31q = 37e = 7c = 308
m =
Answer key
- 1. gcd(624, 516) = 12
- 2. gcd(236, 16) = 4
- 3. 38−1 mod 47 = 26
- 4. φ(49) = 42
- 5. 4347 mod 64 = 3
- 6. m = 1015
Full step-by-step solutions: practise this topic on examproblems.com.