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
aqbr144=?·104+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(144, 104).

a = 144b = 104
gcd(144, 104) =
2.Easy
aqbr342=?·78+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(342, 78).

a = 342b = 78
gcd(342, 78) =
3.Medium

Find the smallest positive integer x with x ≡ 1 (mod 7) and x ≡ 0 (mod 11).

x ≡ 1 (mod 7)x ≡ 0 (mod 11)
x =
4.Medium

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

a = 13n = 31
13−1 mod 31 =
5.Hard

Use repeated squaring to find 1789 mod 62.

a = 17k = 89n = 62
1789 mod 62 =
6.Hard

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

p = 67k = 78169
2378169 mod 67 =

Answer key

  1. 1. gcd(144, 104) = 8
  2. 2. gcd(342, 78) = 6
  3. 3. x = 22
  4. 4. 13−1 mod 31 = 12
  5. 5. 1789 mod 62 = 11
  6. 6. 2378169 mod 67 = 6

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