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

Find (776·53 + 281) mod 5 without multiplying out the large numbers: reduce first.

n = 5
(776·53 + 281) mod 5 =
2.Easy

Find 111² mod 8 without multiplying out the large numbers: reduce first.

n = 8
111² mod 8 =
3.Medium

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

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

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

a = 74n = 97
74−1 mod 97 =
5.Hard
383c = me​ mod n?m = cd​ mod nm(n, e) = (517, 7)d

Encrypt the message m = 383 with the RSA public key (n, e) = (517, 7). Find the ciphertext c.

n = 517e = 7m = 383
c =
6.Hard

Use repeated squaring to find 4107 mod 21.

a = 4k = 107n = 21
4107 mod 21 =

Answer key

  1. 1. (776·53 + 281) mod 5 = 4
  2. 2. 111² mod 8 = 1
  3. 3. 65−1 mod 89 = 63
  4. 4. 74−1 mod 97 = 59
  5. 5. c = 103
  6. 6. 4107 mod 21 = 16

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