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
aqbr450=?·285+??=?·?+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(450, 285).

a = 450b = 285
gcd(450, 285) =
2.Easy
012345678910mod 11

Find (−25) mod 11, the remainder r with 0 ≤ r < 11.

a = −25n = 11
(−25) mod 11 =
3.Medium

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

a = 6n = 29
6−1 mod 29 =
4.Medium

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

a = 16n = 57
16−1 mod 57 =
5.Hard

Use repeated squaring to find 6254 mod 69.

a = 62k = 54n = 69
6254 mod 69 =
6.Hard

67 is prime. Use Fermat’s little theorem to find 2295796 mod 67.

p = 67k = 95796
2295796 mod 67 =

Answer key

  1. 1. gcd(450, 285) = 15
  2. 2. (−25) mod 11 = 8
  3. 3. 6−1 mod 29 = 5
  4. 4. 16−1 mod 57 = 25
  5. 5. 6254 mod 69 = 13
  6. 6. 2295796 mod 67 = 40

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