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 (648·55 + 130) mod 13 without multiplying out the large numbers: reduce first.

n = 13
(648·55 + 130) mod 13 =
2.Easy
01234567891011mod 12

Find 945 mod 12, the remainder r with 0 ≤ r < 12.

a = 945n = 12
945 mod 12 =
3.Medium

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

a = 24n = 43
24−1 mod 43 =
4.Medium

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

a = 29n = 64
29−1 mod 64 =
5.Hard
476c = me​ mod n?m = cd​ mod nm(n, e) = (481, 13)d

Encrypt the message m = 476 with the RSA public key (n, e) = (481, 13). Find the ciphertext c.

n = 481e = 13m = 476
c =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (703, 5)d = ?

An RSA key uses the primes p = 19 and q = 37 and the public exponent e = 5. Find the private exponent d (0 < d < φ(n)).

p = 19q = 37e = 5
d =

Answer key

  1. 1. (648·55 + 130) mod 13 = 7
  2. 2. 945 mod 12 = 9
  3. 3. 24−1 mod 43 = 9
  4. 4. 29−1 mod 64 = 53
  5. 5. c = 320
  6. 6. d = 389

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