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
aqbr1176=?·483+??=?·?+??=?·?+??=?·?+?

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

a = 1176b = 483
lcm(1176, 483) =
2.Easy
012mod 3

Find 586 mod 3, the remainder r with 0 ≤ r < 3.

a = 586n = 3
586 mod 3 =
3.Medium

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

a = 12n = 17
12−1 mod 17 =
4.Medium

Solve 16x ≡ 11 (mod 35). Give the solution x with 0 < x < 35.

16x ≡ 11 (mod 35)
x =
5.Hard

47 is prime. Use Fermat’s little theorem to find 81599 mod 47.

p = 47k = 1599
81599 mod 47 =
6.Hard
mc = me​ mod n32m = cd​ mod n?(n, e) = (259, 19)d

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

p = 7q = 37e = 19c = 32
m =

Answer key

  1. 1. lcm(1176, 483) = 27048
  2. 2. 586 mod 3 = 1
  3. 3. 12−1 mod 17 = 10
  4. 4. x = 16
  5. 5. 81599 mod 47 = 14
  6. 6. m = 116

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