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
aqbr468=?·325+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(468, 325).

a = 468b = 325
gcd(468, 325) =
2.Easy

Find (151·867 + 22) mod 7 without multiplying out the large numbers: reduce first.

n = 7
(151·867 + 22) mod 7 =
3.Medium

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

n = 833 = 72·17
φ(833) =
4.Medium

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

n = 57 = 3·19
φ(57) =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (493, 11)d = ?

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

p = 17q = 29e = 11
d =
6.Hard
206c = me​ mod n?m = cd​ mod nm(n, e) = (235, 13)d

Encrypt the message m = 206 with the RSA public key (n, e) = (235, 13). Find the ciphertext c.

n = 235e = 13m = 206
c =

Answer key

  1. 1. gcd(468, 325) = 13
  2. 2. (151·867 + 22) mod 7 = 4
  3. 3. φ(833) = 672
  4. 4. φ(57) = 36
  5. 5. d = 163
  6. 6. c = 96

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