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
aqbr180=?·141+??=?·?+??=?·?+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(180, 141).

a = 180b = 141
gcd(180, 141) =
2.Easy
aqbr870=?·405+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(870, 405).

a = 870b = 405
gcd(870, 405) =
3.Medium

Find the smallest positive integer x with x ≡ 1 (mod 8) and x ≡ 7 (mod 11).

x ≡ 1 (mod 8)x ≡ 7 (mod 11)
x =
4.Medium

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

a = 22n = 31
22−1 mod 31 =
5.Hard
mc = me​ mod n90m = cd​ mod n?(n, e) = (119, 11)d

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

p = 7q = 17e = 11c = 90
m =
6.Hard

How many solutions N does 40x ≡ 16 (mod 56) have in {0, 1, …, 55}?

40x ≡ 16 (mod 56)
N =

Answer key

  1. 1. gcd(180, 141) = 3
  2. 2. gcd(870, 405) = 15
  3. 3. x = 73
  4. 4. 22−1 mod 31 = 24
  5. 5. m = 6
  6. 6. N = 8

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