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
aqbr660=?·435+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(660, 435).

a = 660b = 435
gcd(660, 435) =
2.Easy
0123mod 4

Find 483 mod 4, the remainder r with 0 ≤ r < 4.

a = 483n = 4
483 mod 4 =
3.Medium

Find Euler’s totient φ(121), the number of integers from 1 to 121 that are coprime to 121.

n = 121 = 112
φ(121) =
4.Medium

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

a = 49n = 61
49−1 mod 61 =
5.Hard

Use repeated squaring to find 1994 mod 37.

a = 19k = 94n = 37
1994 mod 37 =
6.Hard

29 is prime. Use Fermat’s little theorem to find 2791251 mod 29.

p = 29k = 91251
2791251 mod 29 =

Answer key

  1. 1. gcd(660, 435) = 15
  2. 2. 483 mod 4 = 3
  3. 3. φ(121) = 110
  4. 4. 49−1 mod 61 = 5
  5. 5. 1994 mod 37 = 30
  6. 6. 2791251 mod 29 = 14

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