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
aqbr210=?·56+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(210, 56).

a = 210b = 56
gcd(210, 56) =
2.Easy

Find 861² mod 11 without multiplying out the large numbers: reduce first.

n = 11
861² mod 11 =
3.Medium

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

a = 9n = 67
9−1 mod 67 =
4.Medium

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

a = 51n = 88
51−1 mod 88 =
5.Hard

Use repeated squaring to find 3875 mod 71.

a = 38k = 75n = 71
3875 mod 71 =
6.Hard
332c = me​ mod n?m = cd​ mod nm(n, e) = (611, 19)d

Encrypt the message m = 332 with the RSA public key (n, e) = (611, 19). Find the ciphertext c.

n = 611e = 19m = 332
c =

Answer key

  1. 1. gcd(210, 56) = 14
  2. 2. 861² mod 11 = 9
  3. 3. 9−1 mod 67 = 15
  4. 4. 51−1 mod 88 = 19
  5. 5. 3875 mod 71 = 20
  6. 6. c = 253

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