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
aqbr546=?·189+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(546, 189).

a = 546b = 189
gcd(546, 189) =
2.Easy
aqbr144=?·57+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(144, 57).

a = 144b = 57
gcd(144, 57) =
3.Medium

Find the smallest positive integer x with x ≡ 6 (mod 11) and x ≡ 3 (mod 13).

x ≡ 6 (mod 11)x ≡ 3 (mod 13)
x =
4.Medium

Find Euler’s totient φ(17), the number of integers from 1 to 17 that are coprime to 17.

n = 17 = 17
φ(17) =
5.Hard

How many solutions N does 32x ≡ 72 (mod 84) have in {0, 1, …, 83}?

32x ≡ 72 (mod 84)
N =
6.Hard
mc = me​ mod n202m = cd​ mod n?(n, e) = (697, 19)d

An RSA key uses p = 17, q = 41 and e = 19. Decrypt the ciphertext c = 202: find the message m.

p = 17q = 41e = 19c = 202
m =

Answer key

  1. 1. gcd(546, 189) = 21
  2. 2. gcd(144, 57) = 3
  3. 3. x = 94
  4. 4. φ(17) = 16
  5. 5. N = 4
  6. 6. m = 383

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