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
aqbr312=?·162+??=?·?+??=?·?+??=?·?+?

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

a = 312b = 162
lcm(312, 162) =
2.Easy

Find (184·462 + 285) mod 6 without multiplying out the large numbers: reduce first.

n = 6
(184·462 + 285) mod 6 =
3.Medium

Solve 31x ≡ 7 (mod 41). Give the solution x with 0 < x < 41.

31x ≡ 7 (mod 41)
x =
4.Medium

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

a = 34n = 61
34−1 mod 61 =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (205, 7)d = ?

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

p = 5q = 41e = 7
d =
6.Hard

83 is prime. Use Fermat’s little theorem to find 2476826 mod 83.

p = 83k = 76826
2476826 mod 83 =

Answer key

  1. 1. lcm(312, 162) = 8424
  2. 2. (184·462 + 285) mod 6 = 3
  3. 3. x = 28
  4. 4. 34−1 mod 61 = 9
  5. 5. d = 23
  6. 6. 2476826 mod 83 = 17

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