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
aqbr62=?·8+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(62, 8).

a = 62b = 8
gcd(62, 8) =
2.Easy

Find (560·918 + 11) mod 9 without multiplying out the large numbers: reduce first.

n = 9
(560·918 + 11) mod 9 =
3.Medium

Find the smallest positive integer x with x ≡ 9 (mod 10) and x ≡ 10 (mod 13).

x ≡ 9 (mod 10)x ≡ 10 (mod 13)
x =
4.Medium

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

a = 23n = 89
23−1 mod 89 =
5.Hard
mc = me​ mod n54m = cd​ mod n?(n, e) = (115, 17)d

An RSA key uses p = 5, q = 23 and e = 17. Decrypt the ciphertext c = 54: find the message m.

p = 5q = 23e = 17c = 54
m =
6.Hard

Use repeated squaring to find 1288 mod 37.

a = 12k = 88n = 37
1288 mod 37 =

Answer key

  1. 1. gcd(62, 8) = 2
  2. 2. (560·918 + 11) mod 9 = 2
  3. 3. x = 49
  4. 4. 23−1 mod 89 = 31
  5. 5. m = 64
  6. 6. 1288 mod 37 = 9

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