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
aqbr531=?·495+??=?·?+??=?·?+??=?·?+?

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

a = 531b = 495
lcm(531, 495) =
2.Easy

Find 406² mod 12 without multiplying out the large numbers: reduce first.

n = 12
406² mod 12 =
3.Medium

Solve 32x ≡ 44 (mod 53). Give the solution x with 0 < x < 53.

32x ≡ 44 (mod 53)
x =
4.Medium

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

n = 45 = 32·5
φ(45) =
5.Hard
297c = me​ mod n?m = cd​ mod nm(n, e) = (1363, 3)d

Encrypt the message m = 297 with the RSA public key (n, e) = (1363, 3). Find the ciphertext c.

n = 1363e = 3m = 297
c =
6.Hard
mc = me​ mod n283m = cd​ mod n?(n, e) = (403, 17)d

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

p = 13q = 31e = 17c = 283
m =

Answer key

  1. 1. lcm(531, 495) = 29205
  2. 2. 406² mod 12 = 4
  3. 3. x = 8
  4. 4. φ(45) = 24
  5. 5. c = 1213
  6. 6. m = 95

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