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
aqbr312=?·143+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(312, 143).

a = 312b = 143
gcd(312, 143) =
2.Easy
0123456789mod 10

Find 84 mod 10, the remainder r with 0 ≤ r < 10.

a = 84n = 10
84 mod 10 =
3.Medium

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

a = 29n = 81
29−1 mod 81 =
4.Medium

Solve 10x ≡ 25 (mod 47). Give the solution x with 0 < x < 47.

10x ≡ 25 (mod 47)
x =
5.Hard

Use repeated squaring to find 59175 mod 81.

a = 59k = 175n = 81
59175 mod 81 =
6.Hard
138c = me​ mod n?m = cd​ mod nm(n, e) = (731, 5)d

Encrypt the message m = 138 with the RSA public key (n, e) = (731, 5). Find the ciphertext c.

n = 731e = 5m = 138
c =

Answer key

  1. 1. gcd(312, 143) = 13
  2. 2. 84 mod 10 = 4
  3. 3. 29−1 mod 81 = 14
  4. 4. x = 26
  5. 5. 59175 mod 81 = 50
  6. 6. c = 440

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