Use Euclid’s algorithm to find gcd(116, 50).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 116b = 50
gcd(116, 50) =
2.Easy
Find the least common multiple lcm(1176, 819). Use Euclid’s algorithm for the gcd first.
a = 1176b = 819
lcm(1176, 819) =
3.Medium
Find Euler’s totient φ(1183), the number of integers from 1 to 1183 that are coprime to 1183.
n = 1183 = 7·132
φ(1183) =
4.Medium
Find the inverse of 7 modulo 45: the number x with 0 < x < 45 and 7·x ≡ 1 (mod 45).
a = 7n = 45
7−1 mod 45 =
5.Hard
An RSA key uses p = 5, q = 19 and e = 23. Decrypt the ciphertext c = 27: find the message m.
p = 5q = 19e = 23c = 27
m =
6.Hard
Use repeated squaring to find 1622 mod 27.
a = 16k = 22n = 27
1622 mod 27 =
Answer key
- 1. gcd(116, 50) = 2
- 2. lcm(1176, 819) = 45864
- 3. φ(1183) = 936
- 4. 7−1 mod 45 = 13
- 5. m = 88
- 6. 1622 mod 27 = 7
Full step-by-step solutions: practise this topic on examproblems.com.