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
012345mod 6

Find 61 mod 6, the remainder r with 0 ≤ r < 6.

a = 61n = 6
61 mod 6 =
2.Easy
aqbr228=?·192+??=?·?+??=?·?+?

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

a = 228b = 192
lcm(228, 192) =
3.Medium

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

a = 19n = 23
19−1 mod 23 =
4.Medium

Find Euler’s totient φ(119), the number of integers from 1 to 119 that are coprime to 119.

n = 119 = 7·17
φ(119) =
5.Hard

89 is prime. Use Fermat’s little theorem to find 268516 mod 89.

p = 89k = 8516
268516 mod 89 =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (65, 19)d = ?

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

p = 5q = 13e = 19
d =

Answer key

  1. 1. 61 mod 6 = 1
  2. 2. lcm(228, 192) = 3648
  3. 3. 19−1 mod 23 = 17
  4. 4. φ(119) = 96
  5. 5. 268516 mod 89 = 22
  6. 6. d = 43

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