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
01234567891011mod 12

Find 253 mod 12, the remainder r with 0 ≤ r < 12.

a = 253n = 12
253 mod 12 =
2.Easy
012mod 3

Find 86 mod 3, the remainder r with 0 ≤ r < 3.

a = 86n = 3
86 mod 3 =
3.Medium

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

n = 34 = 2·17
φ(34) =
4.Medium

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

a = 59n = 71
59−1 mod 71 =
5.Hard

Use repeated squaring to find 52122 mod 55.

a = 52k = 122n = 55
52122 mod 55 =
6.Hard
390c = me​ mod n?m = cd​ mod nm(n, e) = (703, 13)d

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

n = 703e = 13m = 390
c =

Answer key

  1. 1. 253 mod 12 = 1
  2. 2. 86 mod 3 = 2
  3. 3. φ(34) = 16
  4. 4. 59−1 mod 71 = 65
  5. 5. 52122 mod 55 = 9
  6. 6. c = 298

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