Use Euclid’s algorithm to find gcd(1218, 315).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 1218b = 315
gcd(1218, 315) =
2.Easy
Find 509 mod 6, the remainder r with 0 ≤ r < 6.
a = 509n = 6
509 mod 6 =
3.Medium
Find Euler’s totient φ(39), the number of integers from 1 to 39 that are coprime to 39.
n = 39 = 3·13
φ(39) =
4.Medium
Find Euler’s totient φ(11), the number of integers from 1 to 11 that are coprime to 11.
n = 11 = 11
φ(11) =
5.Hard
79 is prime. Use Fermat’s little theorem to find 670166 mod 79.
p = 79k = 70166
670166 mod 79 =
6.Hard
29 is prime. Use Fermat’s little theorem to find 1676892 mod 29.
p = 29k = 76892
1676892 mod 29 =
Answer key
- 1. gcd(1218, 315) = 21
- 2. 509 mod 6 = 5
- 3. φ(39) = 24
- 4. φ(11) = 10
- 5. 670166 mod 79 = 45
- 6. 1676892 mod 29 = 25
Full step-by-step solutions: practise this topic on examproblems.com.