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
aqbr672=?·180+??=?·?+??=?·?+??=?·?+??=?·?+?

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

a = 672b = 180
gcd(672, 180) =
2.Easy
aqbr552=?·120+??=?·?+??=?·?+??=?·?+?

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

a = 552b = 120
lcm(552, 120) =
3.Medium

Solve 13x ≡ 5 (mod 31). Give the solution x with 0 < x < 31.

13x ≡ 5 (mod 31)
x =
4.Medium

Solve 22x ≡ 9 (mod 47). Give the solution x with 0 < x < 47.

22x ≡ 9 (mod 47)
x =
5.Hard

71 is prime. Use Fermat’s little theorem to find 935233 mod 71.

p = 71k = 35233
935233 mod 71 =
6.Hard

Use repeated squaring to find 19125 mod 63.

a = 19k = 125n = 63
19125 mod 63 =

Answer key

  1. 1. gcd(672, 180) = 12
  2. 2. lcm(552, 120) = 2760
  3. 3. x = 29
  4. 4. x = 41
  5. 5. 935233 mod 71 = 2
  6. 6. 19125 mod 63 = 10

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