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
aqbr477=?·279+??=?·?+??=?·?+??=?·?+??=?·?+?

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

a = 477b = 279
lcm(477, 279) =
2.Easy
012345mod 6

Find (−95) mod 6, the remainder r with 0 ≤ r < 6.

a = −95n = 6
(−95) mod 6 =
3.Medium

Find the smallest positive integer x with x ≡ 4 (mod 6) and x ≡ 12 (mod 13).

x ≡ 4 (mod 6)x ≡ 12 (mod 13)
x =
4.Medium

Find the smallest positive integer x with x ≡ 4 (mod 5) and x ≡ 5 (mod 7).

x ≡ 4 (mod 5)x ≡ 5 (mod 7)
x =
5.Hard

Use repeated squaring to find 25172 mod 41.

a = 25k = 172n = 41
25172 mod 41 =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (713, 17)d = ?

An RSA key uses the primes p = 23 and q = 31 and the public exponent e = 17. Find the private exponent d (0 < d < φ(n)).

p = 23q = 31e = 17
d =

Answer key

  1. 1. lcm(477, 279) = 14787
  2. 2. (−95) mod 6 = 1
  3. 3. x = 64
  4. 4. x = 19
  5. 5. 25172 mod 41 = 10
  6. 6. d = 233

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