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
012mod 3

Find (−22) mod 3, the remainder r with 0 ≤ r < 3.

a = −22n = 3
(−22) mod 3 =
2.Easy
012345678mod 9

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

a = 897n = 9
897 mod 9 =
3.Medium

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

a = 49n = 89
49−1 mod 89 =
4.Medium

Find the smallest positive integer x with x ≡ 3 (mod 5) and x ≡ 2 (mod 9).

x ≡ 3 (mod 5)x ≡ 2 (mod 9)
x =
5.Hard

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

p = 59k = 45079
1945079 mod 59 =
6.Hard
508c = me​ mod n?m = cd​ mod nm(n, e) = (1081, 13)d

Encrypt the message m = 508 with the RSA public key (n, e) = (1081, 13). Find the ciphertext c.

n = 1081e = 13m = 508
c =

Answer key

  1. 1. (−22) mod 3 = 2
  2. 2. 897 mod 9 = 6
  3. 3. 49−1 mod 89 = 20
  4. 4. x = 38
  5. 5. 1945079 mod 59 = 57
  6. 6. c = 349

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