Use Euclid’s algorithm to find gcd(945, 357).
Number theory & modular arithmetic worksheet with answers
1.Easy
a = 945b = 357
gcd(945, 357) =
2.Easy
Find (−147) mod 10, the remainder r with 0 ≤ r < 10.
a = −147n = 10
(−147) mod 10 =
3.Medium
Find the smallest positive integer x with x ≡ 8 (mod 10) and x ≡ 7 (mod 13).
x ≡ 8 (mod 10)x ≡ 7 (mod 13)
x =
4.Medium
Find Euler’s totient φ(1125), the number of integers from 1 to 1125 that are coprime to 1125.
n = 1125 = 32·53
φ(1125) =
5.Hard
An RSA key uses the primes p = 31 and q = 41 and the public exponent e = 13. Find the private exponent d (0 < d < φ(n)).
p = 31q = 41e = 13
d =
6.Hard
Encrypt the message m = 106 with the RSA public key (n, e) = (155, 7). Find the ciphertext c.
n = 155e = 7m = 106
c =
Answer key
- 1. gcd(945, 357) = 21
- 2. (−147) mod 10 = 3
- 3. x = 98
- 4. φ(1125) = 600
- 5. d = 277
- 6. c = 146
Full step-by-step solutions: practise this topic on examproblems.com.