Use Euclid’s algorithm to find gcd(341, 187).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 341b = 187
gcd(341, 187) =
2.Easy
Find (−102) mod 7, the remainder r with 0 ≤ r < 7.
a = −102n = 7
(−102) mod 7 =
3.Medium
Find the inverse of 52 modulo 59: the number x with 0 < x < 59 and 52·x ≡ 1 (mod 59).
a = 52n = 59
52−1 mod 59 =
4.Medium
Find Euler’s totient φ(125), the number of integers from 1 to 125 that are coprime to 125.
n = 125 = 53
φ(125) =
5.Hard
An RSA key uses the primes p = 13 and q = 17 and the public exponent e = 5. Find the private exponent d (0 < d < φ(n)).
p = 13q = 17e = 5
d =
6.Hard
An RSA key uses the primes p = 19 and q = 43 and the public exponent e = 5. Find the private exponent d (0 < d < φ(n)).
p = 19q = 43e = 5
d =
Answer key
- 1. gcd(341, 187) = 11
- 2. (−102) mod 7 = 3
- 3. 52−1 mod 59 = 42
- 4. φ(125) = 100
- 5. d = 77
- 6. d = 605
Full step-by-step solutions: practise this topic on examproblems.com.