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 (−22) mod 10, the remainder r with 0 ≤ r < 10.

a = −22n = 10
(−22) mod 10 =
2.Easy
aqbr392=?·272+??=?·?+??=?·?+??=?·?+??=?·?+?

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

a = 392b = 272
lcm(392, 272) =
3.Medium

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

a = 10n = 17
10−1 mod 17 =
4.Medium

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

n = 98 = 2·72
φ(98) =
5.Hard
1306c = me​ mod n?m = cd​ mod nm(n, e) = (1517, 7)d

Encrypt the message m = 1306 with the RSA public key (n, e) = (1517, 7). Find the ciphertext c.

n = 1517e = 7m = 1306
c =
6.Hard

Use repeated squaring to find 236 mod 93.

a = 2k = 36n = 93
236 mod 93 =

Answer key

  1. 1. (−22) mod 10 = 8
  2. 2. lcm(392, 272) = 13328
  3. 3. 10−1 mod 17 = 12
  4. 4. φ(98) = 42
  5. 5. c = 381
  6. 6. 236 mod 93 = 64

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