Number theory & modular arithmetic worksheet with answers

Free printable Number theory & modular arithmetic worksheet: 6 problems from easy to exam level, with an answer key. Print it or save it as a PDF.

For teachers: free to print, copy and use in class. Every new worksheet has new values and its own answer key. A link to ExamProblems on your course page is appreciated.

Name: ____________________   Date: ____________

1.Easy
aqbr106=?·90+??=?·?+??=?·?+??=?·?+??=?·?+??=?·?+?

Find the least common multiple lcm(106, 90). Use Euclid’s algorithm for the gcd first.

a = 106b = 90
lcm(106, 90) =
2.Easy
aqbr323=?·238+??=?·?+??=?·?+??=?·?+?

Find the least common multiple lcm(323, 238). Use Euclid’s algorithm for the gcd first.

a = 323b = 238
lcm(323, 238) =
3.Medium

Find the inverse of 11 modulo 21: the number x with 0 < x < 21 and 11·x ≡ 1 (mod 21).

a = 11n = 21
11−1 mod 21 =
4.Medium

Find the inverse of 23 modulo 29: the number x with 0 < x < 29 and 23·x ≡ 1 (mod 29).

a = 23n = 29
23−1 mod 29 =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (391, 5)d = ?

An RSA key uses the primes p = 17 and q = 23 and the public exponent e = 5. Find the private exponent d (0 < d < φ(n)).

p = 17q = 23e = 5
d =
6.Hard
mc = me​ mod n108m = cd​ mod n?(n, e) = (1271, 7)d

An RSA key uses p = 31, q = 41 and e = 7. Decrypt the ciphertext c = 108: find the message m.

p = 31q = 41e = 7c = 108
m =

Answer key

  1. 1. lcm(106, 90) = 4770
  2. 2. lcm(323, 238) = 4522
  3. 3. 11−1 mod 21 = 2
  4. 4. 23−1 mod 29 = 24
  5. 5. d = 141
  6. 6. m = 833

Full step-by-step solutions: practise this topic on examproblems.com.