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
aqbr697=?·408+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(697, 408).

a = 697b = 408
gcd(697, 408) =
2.Easy
0123456mod 7

Find (−23) mod 7, the remainder r with 0 ≤ r < 7.

a = −23n = 7
(−23) mod 7 =
3.Medium

Solve 39x ≡ 15 (mod 49). Give the solution x with 0 < x < 49.

39x ≡ 15 (mod 49)
x =
4.Medium

Solve 25x ≡ 12 (mod 29). Give the solution x with 0 < x < 29.

25x ≡ 12 (mod 29)
x =
5.Hard

Use repeated squaring to find 1091 mod 49.

a = 10k = 91n = 49
1091 mod 49 =
6.Hard

17 is prime. Use Fermat’s little theorem to find 1568827 mod 17.

p = 17k = 68827
1568827 mod 17 =

Answer key

  1. 1. gcd(697, 408) = 17
  2. 2. (−23) mod 7 = 5
  3. 3. x = 23
  4. 4. x = 26
  5. 5. 1091 mod 49 = 31
  6. 6. 1568827 mod 17 = 9

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