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
012345mod 6

Find (−8) mod 6, the remainder r with 0 ≤ r < 6.

a = −8n = 6
(−8) mod 6 =
2.Easy

Find 622² mod 7 without multiplying out the large numbers: reduce first.

n = 7
622² mod 7 =
3.Medium

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

x ≡ 3 (mod 4)x ≡ 4 (mod 5)
x =
4.Medium

Find the smallest positive integer x with x ≡ 3 (mod 5) and x ≡ 10 (mod 11).

x ≡ 3 (mod 5)x ≡ 10 (mod 11)
x =
5.Hard
mc = me​ mod n74m = cd​ mod n?(n, e) = (221, 7)d

An RSA key uses p = 13, q = 17 and e = 7. Decrypt the ciphertext c = 74: find the message m.

p = 13q = 17e = 7c = 74
m =
6.Hard
971c = me​ mod n?m = cd​ mod nm(n, e) = (1081, 5)d

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

n = 1081e = 5m = 971
c =

Answer key

  1. 1. (−8) mod 6 = 4
  2. 2. 622² mod 7 = 1
  3. 3. x = 19
  4. 4. x = 43
  5. 5. m = 48
  6. 6. c = 135

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