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
0123456mod 7

Find (−11) mod 7, the remainder r with 0 ≤ r < 7.

a = −11n = 7
(−11) mod 7 =
2.Easy
aqbr748=?·255+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(748, 255).

a = 748b = 255
gcd(748, 255) =
3.Medium

Find Euler’s totient φ(121), the number of integers from 1 to 121 that are coprime to 121.

n = 121 = 112
φ(121) =
4.Medium

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

a = 33n = 62
33−1 mod 62 =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (559, 5)d = ?

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

p = 13q = 43e = 5
d =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (95, 5)d = ?

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

p = 5q = 19e = 5
d =

Answer key

  1. 1. (−11) mod 7 = 3
  2. 2. gcd(748, 255) = 17
  3. 3. φ(121) = 110
  4. 4. 33−1 mod 62 = 47
  5. 5. d = 101
  6. 6. d = 29

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