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
aqbr344=?·304+??=?·?+??=?·?+??=?·?+??=?·?+?

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

a = 344b = 304
lcm(344, 304) =
2.Easy
01234567mod 8

Find 154 mod 8, the remainder r with 0 ≤ r < 8.

a = 154n = 8
154 mod 8 =
3.Medium

Find the smallest positive integer x with x ≡ 3 (mod 4) and x ≡ 0 (mod 9).

x ≡ 3 (mod 4)x ≡ 0 (mod 9)
x =
4.Medium

Find the smallest positive integer x with x ≡ 4 (mod 8) and x ≡ 6 (mod 11).

x ≡ 4 (mod 8)x ≡ 6 (mod 11)
x =
5.Hard

59 is prime. Use Fermat’s little theorem to find 2499822 mod 59.

p = 59k = 99822
2499822 mod 59 =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (341, 7)d = ?

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

p = 11q = 31e = 7
d =

Answer key

  1. 1. lcm(344, 304) = 13072
  2. 2. 154 mod 8 = 2
  3. 3. x = 27
  4. 4. x = 28
  5. 5. 2499822 mod 59 = 19
  6. 6. d = 43

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