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
0123456789mod 10

Find (−75) mod 10, the remainder r with 0 ≤ r < 10.

a = −75n = 10
(−75) mod 10 =
2.Easy
aqbr522=?·180+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(522, 180).

a = 522b = 180
gcd(522, 180) =
3.Medium

Solve 8x ≡ 6 (mod 47). Give the solution x with 0 < x < 47.

8x ≡ 6 (mod 47)
x =
4.Medium

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

a = 10n = 13
10−1 mod 13 =
5.Hard

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

p = 89k = 88845
688845 mod 89 =
6.Hard
335c = me​ mod n?m = cd​ mod nm(n, e) = (341, 23)d

Encrypt the message m = 335 with the RSA public key (n, e) = (341, 23). Find the ciphertext c.

n = 341e = 23m = 335
c =

Answer key

  1. 1. (−75) mod 10 = 5
  2. 2. gcd(522, 180) = 18
  3. 3. x = 36
  4. 4. 10−1 mod 13 = 4
  5. 5. 688845 mod 89 = 41
  6. 6. c = 191

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