Find (−50) mod 8, the remainder r with 0 ≤ r < 8.
Number theory & modular arithmetic worksheet with answers
1.Easy
a = −50n = 8
(−50) mod 8 =
2.Easy
Find (−43) mod 3, the remainder r with 0 ≤ r < 3.
a = −43n = 3
(−43) mod 3 =
3.Medium
Find the inverse of 3 modulo 53: the number x with 0 < x < 53 and 3·x ≡ 1 (mod 53).
a = 3n = 53
3−1 mod 53 =
4.Medium
Find the inverse of 32 modulo 47: the number x with 0 < x < 47 and 32·x ≡ 1 (mod 47).
a = 32n = 47
32−1 mod 47 =
5.Hard
An RSA key uses p = 11, q = 43 and e = 19. Decrypt the ciphertext c = 335: find the message m.
p = 11q = 43e = 19c = 335
m =
6.Hard
Encrypt the message m = 514 with the RSA public key (n, e) = (799, 17). Find the ciphertext c.
n = 799e = 17m = 514
c =
Answer key
- 1. (−50) mod 8 = 6
- 2. (−43) mod 3 = 2
- 3. 3−1 mod 53 = 18
- 4. 32−1 mod 47 = 25
- 5. m = 416
- 6. c = 327
Full step-by-step solutions: practise this topic on examproblems.com.