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
aqbr754=?·637+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(754, 637).

a = 754b = 637
gcd(754, 637) =
2.Easy
aqbr1050=?·903+??=?·?+??=?·?+?

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

a = 1050b = 903
lcm(1050, 903) =
3.Medium

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

a = 49n = 74
49−1 mod 74 =
4.Medium

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

n = 1183 = 7·132
φ(1183) =
5.Hard

Use repeated squaring to find 34149 mod 77.

a = 34k = 149n = 77
34149 mod 77 =
6.Hard

89 is prime. Use Fermat’s little theorem to find 259281 mod 89.

p = 89k = 59281
259281 mod 89 =

Answer key

  1. 1. gcd(754, 637) = 13
  2. 2. lcm(1050, 903) = 45150
  3. 3. 49−1 mod 74 = 71
  4. 4. φ(1183) = 936
  5. 5. 34149 mod 77 = 34
  6. 6. 259281 mod 89 = 4

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