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
aqbr240=?·114+??=?·?+??=?·?+?

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

a = 240b = 114
lcm(240, 114) =
2.Easy
aqbr259=?·238+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(259, 238).

a = 259b = 238
gcd(259, 238) =
3.Medium

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

a = 27n = 31
27−1 mod 31 =
4.Medium

Solve 7x ≡ 25 (mod 34). Give the solution x with 0 < x < 34.

7x ≡ 25 (mod 34)
x =
5.Hard

Solve 54x ≡ 38 (mod 56). Give the smallest positive solution x.

54x ≡ 38 (mod 56)
x =
6.Hard
mc = me​ mod n27m = cd​ mod n?(n, e) = (221, 23)d

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

p = 13q = 17e = 23c = 27
m =

Answer key

  1. 1. lcm(240, 114) = 4560
  2. 2. gcd(259, 238) = 7
  3. 3. 27−1 mod 31 = 23
  4. 4. x = 23
  5. 5. x = 9
  6. 6. m = 209

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