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
aqbr159=?·33+??=?·?+??=?·?+??=?·?+?

Find the least common multiple lcm(159, 33). Use Euclid’s algorithm for the gcd first.

a = 159b = 33
lcm(159, 33) =
2.Easy
012345mod 6

Find (−74) mod 6, the remainder r with 0 ≤ r < 6.

a = −74n = 6
(−74) mod 6 =
3.Medium

Solve 26x ≡ 5 (mod 55). Give the solution x with 0 < x < 55.

26x ≡ 5 (mod 55)
x =
4.Medium

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

a = 39n = 74
39−1 mod 74 =
5.Hard

23 is prime. Use Fermat’s little theorem to find 720920 mod 23.

p = 23k = 20920
720920 mod 23 =
6.Hard

Use repeated squaring to find 231 mod 35.

a = 2k = 31n = 35
231 mod 35 =

Answer key

  1. 1. lcm(159, 33) = 1749
  2. 2. (−74) mod 6 = 4
  3. 3. x = 15
  4. 4. 39−1 mod 74 = 19
  5. 5. 720920 mod 23 = 8
  6. 6. 231 mod 35 = 23

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