Find (−16) mod 9, the remainder r with 0 ≤ r < 9.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = −16n = 9
(−16) mod 9 =
2.Easy
Use Euclid’s algorithm to find gcd(392, 376).
a = 392b = 376
gcd(392, 376) =
3.Medium
Find Euler’s totient φ(637), the number of integers from 1 to 637 that are coprime to 637.
n = 637 = 72·13
φ(637) =
4.Medium
Solve 25x ≡ 34 (mod 94). Give the solution x with 0 < x < 94.
25x ≡ 34 (mod 94)
x =
5.Hard
Encrypt the message m = 558 with the RSA public key (n, e) = (2021, 17). Find the ciphertext c.
n = 2021e = 17m = 558
c =
6.Hard
Encrypt the message m = 167 with the RSA public key (n, e) = (517, 3). Find the ciphertext c.
n = 517e = 3m = 167
c =
Answer key
- 1. (−16) mod 9 = 2
- 2. gcd(392, 376) = 8
- 3. φ(637) = 504
- 4. x = 54
- 5. c = 257
- 6. c = 327
Full step-by-step solutions: practise this topic on examproblems.com.