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
0123456mod 7

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

a = −80n = 7
(−80) mod 7 =
2.Easy
aqbr318=?·294+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(318, 294).

a = 318b = 294
gcd(318, 294) =
3.Medium

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

a = 7n = 39
7−1 mod 39 =
4.Medium

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

a = 42n = 47
42−1 mod 47 =
5.Hard

19 is prime. Use Fermat’s little theorem to find 1847169 mod 19.

p = 19k = 47169
1847169 mod 19 =
6.Hard

How many solutions N does 18x ≡ 10 (mod 50) have in {0, 1, …, 49}?

18x ≡ 10 (mod 50)
N =

Answer key

  1. 1. (−80) mod 7 = 4
  2. 2. gcd(318, 294) = 6
  3. 3. 7−1 mod 39 = 28
  4. 4. 42−1 mod 47 = 28
  5. 5. 1847169 mod 19 = 18
  6. 6. N = 2

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