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
aqbr243=?·198+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(243, 198).

a = 243b = 198
gcd(243, 198) =
2.Easy
012345mod 6

Find 751 mod 6, the remainder r with 0 ≤ r < 6.

a = 751n = 6
751 mod 6 =
3.Medium

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

a = 60n = 91
60−1 mod 91 =
4.Medium

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

a = 32n = 77
32−1 mod 77 =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (133, 13)d = ?

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

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

37 is prime. Use Fermat’s little theorem to find 597220 mod 37.

p = 37k = 97220
597220 mod 37 =

Answer key

  1. 1. gcd(243, 198) = 9
  2. 2. 751 mod 6 = 1
  3. 3. 60−1 mod 91 = 44
  4. 4. 32−1 mod 77 = 65
  5. 5. d = 25
  6. 6. 597220 mod 37 = 12

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