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
aqbr612=?·126+??=?·?+??=?·?+?

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

a = 612b = 126
lcm(612, 126) =
2.Easy
aqbr354=?·252+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(354, 252).

a = 354b = 252
gcd(354, 252) =
3.Medium

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

a = 8n = 19
8−1 mod 19 =
4.Medium

Solve 11x ≡ 5 (mod 17). Give the solution x with 0 < x < 17.

11x ≡ 5 (mod 17)
x =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (893, 7)d = ?

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

p = 19q = 47e = 7
d =
6.Hard

Use repeated squaring to find 18109 mod 29.

a = 18k = 109n = 29
18109 mod 29 =

Answer key

  1. 1. lcm(612, 126) = 4284
  2. 2. gcd(354, 252) = 6
  3. 3. 8−1 mod 19 = 12
  4. 4. x = 2
  5. 5. d = 355
  6. 6. 18109 mod 29 = 10

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