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
aqbr1224=?·1176+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(1224, 1176).

a = 1224b = 1176
gcd(1224, 1176) =
2.Easy
aqbr636=?·432+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(636, 432).

a = 636b = 432
gcd(636, 432) =
3.Medium

Solve 42x ≡ 34 (mod 59). Give the solution x with 0 < x < 59.

42x ≡ 34 (mod 59)
x =
4.Medium

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

a = 5n = 37
5−1 mod 37 =
5.Hard

Use repeated squaring to find 91183 mod 97.

a = 91k = 183n = 97
91183 mod 97 =
6.Hard

Solve 24x ≡ 14 (mod 34). Give the smallest positive solution x.

24x ≡ 14 (mod 34)
x =

Answer key

  1. 1. gcd(1224, 1176) = 24
  2. 2. gcd(636, 432) = 12
  3. 3. x = 57
  4. 4. 5−1 mod 37 = 15
  5. 5. 91183 mod 97 = 75
  6. 6. x = 2

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