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
012345678mod 9

Find 130 mod 9, the remainder r with 0 ≤ r < 9.

a = 130n = 9
130 mod 9 =
2.Easy

Find 330² mod 13 without multiplying out the large numbers: reduce first.

n = 13
330² mod 13 =
3.Medium

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

n = 19 = 19
φ(19) =
4.Medium

Solve 25x ≡ 37 (mod 67). Give the solution x with 0 < x < 67.

25x ≡ 37 (mod 67)
x =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (703, 5)d = ?

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

p = 19q = 37e = 5
d =
6.Hard

53 is prime. Use Fermat’s little theorem to find 2285558 mod 53.

p = 53k = 85558
2285558 mod 53 =

Answer key

  1. 1. 130 mod 9 = 4
  2. 2. 330² mod 13 = 12
  3. 3. φ(19) = 18
  4. 4. x = 39
  5. 5. d = 389
  6. 6. 2285558 mod 53 = 43

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