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
aqbr495=?·300+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(495, 300).

a = 495b = 300
gcd(495, 300) =
2.Easy

Find (113·104) mod 10 without multiplying out the large numbers: reduce first.

n = 10
(113·104) mod 10 =
3.Medium

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

a = 34n = 97
34−1 mod 97 =
4.Medium

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

a = 49n = 73
49−1 mod 73 =
5.Hard

Use repeated squaring to find 32167 mod 43.

a = 32k = 167n = 43
32167 mod 43 =
6.Hard
mc = me​ mod n37m = cd​ mod n?(n, e) = (287, 13)d

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

p = 7q = 41e = 13c = 37
m =

Answer key

  1. 1. gcd(495, 300) = 15
  2. 2. (113·104) mod 10 = 2
  3. 3. 34−1 mod 97 = 20
  4. 4. 49−1 mod 73 = 3
  5. 5. 32167 mod 43 = 39
  6. 6. m = 16

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