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
aqbr660=?·432+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(660, 432).

a = 660b = 432
gcd(660, 432) =
2.Easy
0123456mod 7

Find 709 mod 7, the remainder r with 0 ≤ r < 7.

a = 709n = 7
709 mod 7 =
3.Medium

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

a = 16n = 55
16−1 mod 55 =
4.Medium

Solve 52x ≡ 11 (mod 81). Give the solution x with 0 < x < 81.

52x ≡ 11 (mod 81)
x =
5.Hard
4c = me​ mod n?m = cd​ mod nm(n, e) = (533, 23)d

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

n = 533e = 23m = 4
c =
6.Hard

Solve 8x ≡ 4 (mod 30). Give the smallest positive solution x.

8x ≡ 4 (mod 30)
x =

Answer key

  1. 1. gcd(660, 432) = 12
  2. 2. 709 mod 7 = 2
  3. 3. 16−1 mod 55 = 31
  4. 4. x = 8
  5. 5. c = 23
  6. 6. x = 8

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