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

Find (268·821 + 92) mod 13 without multiplying out the large numbers: reduce first.

n = 13
(268·821 + 92) mod 13 =
2.Easy
aqbr954=?·720+??=?·?+??=?·?+?

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

a = 954b = 720
lcm(954, 720) =
3.Medium

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

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

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

a = 26n = 59
26−1 mod 59 =
5.Hard

Use repeated squaring to find 8122 mod 13.

a = 8k = 122n = 13
8122 mod 13 =
6.Hard
mc = me​ mod n6m = cd​ mod n?(n, e) = (91, 7)d

An RSA key uses p = 7, q = 13 and e = 7. Decrypt the ciphertext c = 6: find the message m.

p = 7q = 13e = 7c = 6
m =

Answer key

  1. 1. (268·821 + 92) mod 13 = 4
  2. 2. lcm(954, 720) = 38160
  3. 3. 39−1 mod 97 = 5
  4. 4. 26−1 mod 59 = 25
  5. 5. 8122 mod 13 = 12
  6. 6. m = 20

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