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
aqbr585=?·465+??=?·?+??=?·?+??=?·?+?

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

a = 585b = 465
lcm(585, 465) =
2.Easy

Find (692·963 + 268) mod 11 without multiplying out the large numbers: reduce first.

n = 11
(692·963 + 268) mod 11 =
3.Medium

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

a = 21n = 47
21−1 mod 47 =
4.Medium

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

a = 51n = 80
51−1 mod 80 =
5.Hard
mc = me​ mod n390m = cd​ mod n?(n, e) = (1517, 11)d

An RSA key uses p = 37, q = 41 and e = 11. Decrypt the ciphertext c = 390: find the message m.

p = 37q = 41e = 11c = 390
m =
6.Hard
52c = me​ mod n?m = cd​ mod nm(n, e) = (341, 23)d

Encrypt the message m = 52 with the RSA public key (n, e) = (341, 23). Find the ciphertext c.

n = 341e = 23m = 52
c =

Answer key

  1. 1. lcm(585, 465) = 18135
  2. 2. (692·963 + 268) mod 11 = 9
  3. 3. 21−1 mod 47 = 9
  4. 4. 51−1 mod 80 = 11
  5. 5. m = 389
  6. 6. c = 17

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