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

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

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

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

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

Solve 36x ≡ 59 (mod 67). Give the solution x with 0 < x < 67.

36x ≡ 59 (mod 67)
x =
4.Medium

Find the smallest positive integer x with x ≡ 1 (mod 3) and x ≡ 5 (mod 8).

x ≡ 1 (mod 3)x ≡ 5 (mod 8)
x =
5.Hard

Use repeated squaring to find 5639 mod 59.

a = 56k = 39n = 59
5639 mod 59 =
6.Hard

73 is prime. Use Fermat’s little theorem to find 2429986 mod 73.

p = 73k = 29986
2429986 mod 73 =

Answer key

  1. 1. gcd(1008, 408) = 24
  2. 2. (−97) mod 7 = 1
  3. 3. x = 37
  4. 4. x = 13
  5. 5. 5639 mod 59 = 10
  6. 6. 2429986 mod 73 = 9

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