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
0123mod 4

Find 595 mod 4, the remainder r with 0 ≤ r < 4.

a = 595n = 4
595 mod 4 =
2.Easy
aqbr102=?·42+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(102, 42).

a = 102b = 42
gcd(102, 42) =
3.Medium

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

a = 65n = 77
65−1 mod 77 =
4.Medium

Solve 14x ≡ 23 (mod 27). Give the solution x with 0 < x < 27.

14x ≡ 23 (mod 27)
x =
5.Hard

Use repeated squaring to find 3670 mod 41.

a = 36k = 70n = 41
3670 mod 41 =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (731, 11)d = ?

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

p = 17q = 43e = 11
d =

Answer key

  1. 1. 595 mod 4 = 3
  2. 2. gcd(102, 42) = 6
  3. 3. 65−1 mod 77 = 32
  4. 4. x = 19
  5. 5. 3670 mod 41 = 40
  6. 6. d = 611

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