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
aqbr84=?·34+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(84, 34).

a = 84b = 34
gcd(84, 34) =
2.Easy
aqbr184=?·24+??=?·?+??=?·?+?

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

a = 184b = 24
lcm(184, 24) =
3.Medium

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

a = 24n = 37
24−1 mod 37 =
4.Medium

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

a = 10n = 53
10−1 mod 53 =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (115, 3)d = ?

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

p = 5q = 23e = 3
d =
6.Hard

How many solutions N does 12x ≡ 3 (mod 21) have in {0, 1, …, 20}?

12x ≡ 3 (mod 21)
N =

Answer key

  1. 1. gcd(84, 34) = 2
  2. 2. lcm(184, 24) = 552
  3. 3. 24−1 mod 37 = 17
  4. 4. 10−1 mod 53 = 16
  5. 5. d = 59
  6. 6. N = 3

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