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
aqbr885=?·120+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(885, 120).

a = 885b = 120
gcd(885, 120) =
2.Easy

Find (885·395 + 150) mod 12 without multiplying out the large numbers: reduce first.

n = 12
(885·395 + 150) mod 12 =
3.Medium

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

a = 57n = 89
57−1 mod 89 =
4.Medium

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

a = 11n = 73
11−1 mod 73 =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (215, 17)d = ?

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

p = 5q = 43e = 17
d =
6.Hard

53 is prime. Use Fermat’s little theorem to find 1385357 mod 53.

p = 53k = 85357
1385357 mod 53 =

Answer key

  1. 1. gcd(885, 120) = 15
  2. 2. (885·395 + 150) mod 12 = 9
  3. 3. 57−1 mod 89 = 25
  4. 4. 11−1 mod 73 = 20
  5. 5. d = 89
  6. 6. 1385357 mod 53 = 49

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