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
0123456789mod 10

Find (−75) mod 10, the remainder r with 0 ≤ r < 10.

a = −75n = 10
(−75) mod 10 =
2.Easy
aqbr598=?·455+??=?·?+??=?·?+??=?·?+?

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

a = 598b = 455
lcm(598, 455) =
3.Medium

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

n = 171 = 32·19
φ(171) =
4.Medium

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

n = 247 = 13·19
φ(247) =
5.Hard
279c = me​ mod n?m = cd​ mod nm(n, e) = (893, 17)d

Encrypt the message m = 279 with the RSA public key (n, e) = (893, 17). Find the ciphertext c.

n = 893e = 17m = 279
c =
6.Hard

Use repeated squaring to find 53193 mod 69.

a = 53k = 193n = 69
53193 mod 69 =

Answer key

  1. 1. (−75) mod 10 = 5
  2. 2. lcm(598, 455) = 20930
  3. 3. φ(171) = 108
  4. 4. φ(247) = 216
  5. 5. c = 421
  6. 6. 53193 mod 69 = 65

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