Use Euclid’s algorithm to find gcd(645, 405).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 645b = 405
gcd(645, 405) =
2.Easy
Find 829² mod 5 without multiplying out the large numbers: reduce first.
n = 5
829² mod 5 =
3.Medium
Find Euler’s totient φ(845), the number of integers from 1 to 845 that are coprime to 845.
n = 845 = 5·132
φ(845) =
4.Medium
Find the inverse of 16 modulo 71: the number x with 0 < x < 71 and 16·x ≡ 1 (mod 71).
a = 16n = 71
16−1 mod 71 =
5.Hard
73 is prime. Use Fermat’s little theorem to find 653431 mod 73.
p = 73k = 53431
653431 mod 73 =
6.Hard
An RSA key uses p = 13, q = 37 and e = 23. Decrypt the ciphertext c = 176: find the message m.
p = 13q = 37e = 23c = 176
m =
Answer key
- 1. gcd(645, 405) = 15
- 2. 829² mod 5 = 1
- 3. φ(845) = 624
- 4. 16−1 mod 71 = 40
- 5. 653431 mod 73 = 54
- 6. m = 67
Full step-by-step solutions: practise this topic on examproblems.com.