Find 424 mod 6, the remainder r with 0 ≤ r < 6.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 424n = 6
424 mod 6 =
2.Easy
Use Euclid’s algorithm to find gcd(70, 32).
a = 70b = 32
gcd(70, 32) =
3.Medium
Find the inverse of 17 modulo 41: the number x with 0 < x < 41 and 17·x ≡ 1 (mod 41).
a = 17n = 41
17−1 mod 41 =
4.Medium
Find the inverse of 20 modulo 59: the number x with 0 < x < 59 and 20·x ≡ 1 (mod 59).
a = 20n = 59
20−1 mod 59 =
5.Hard
An RSA key uses the primes p = 5 and q = 29 and the public exponent e = 17. Find the private exponent d (0 < d < φ(n)).
p = 5q = 29e = 17
d =
6.Hard
Encrypt the message m = 128 with the RSA public key (n, e) = (185, 13). Find the ciphertext c.
n = 185e = 13m = 128
c =
Answer key
- 1. 424 mod 6 = 4
- 2. gcd(70, 32) = 2
- 3. 17−1 mod 41 = 29
- 4. 20−1 mod 59 = 3
- 5. d = 33
- 6. c = 183
Full step-by-step solutions: practise this topic on examproblems.com.