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

Find (460·691) mod 13 without multiplying out the large numbers: reduce first.

n = 13
(460·691) mod 13 =
2.Easy

Find (631·787 + 173) mod 12 without multiplying out the large numbers: reduce first.

n = 12
(631·787 + 173) mod 12 =
3.Medium

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

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

Solve 63x ≡ 18 (mod 73). Give the solution x with 0 < x < 73.

63x ≡ 18 (mod 73)
x =
5.Hard

59 is prime. Use Fermat’s little theorem to find 98928 mod 59.

p = 59k = 8928
98928 mod 59 =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (217, 13)d = ?

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

p = 7q = 31e = 13
d =

Answer key

  1. 1. (460·691) mod 13 = 10
  2. 2. (631·787 + 173) mod 12 = 6
  3. 3. 6−1 mod 23 = 4
  4. 4. x = 42
  5. 5. 98928 mod 59 = 5
  6. 6. d = 97

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