Find 89 mod 7, the remainder r with 0 ≤ r < 7.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 89n = 7
89 mod 7 =
2.Easy
Use Euclid’s algorithm to find gcd(148, 40).
a = 148b = 40
gcd(148, 40) =
3.Medium
Find the inverse of 4 modulo 19: the number x with 0 < x < 19 and 4·x ≡ 1 (mod 19).
a = 4n = 19
4−1 mod 19 =
4.Medium
Find Euler’s totient φ(221), the number of integers from 1 to 221 that are coprime to 221.
n = 221 = 13·17
φ(221) =
5.Hard
An RSA key uses the primes p = 17 and q = 29 and the public exponent e = 13. Find the private exponent d (0 < d < φ(n)).
p = 17q = 29e = 13
d =
6.Hard
Encrypt the message m = 47 with the RSA public key (n, e) = (217, 17). Find the ciphertext c.
n = 217e = 17m = 47
c =
Answer key
- 1. 89 mod 7 = 5
- 2. gcd(148, 40) = 4
- 3. 4−1 mod 19 = 5
- 4. φ(221) = 192
- 5. d = 69
- 6. c = 101
Full step-by-step solutions: practise this topic on examproblems.com.