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

Find 758² mod 9 without multiplying out the large numbers: reduce first.

n = 9
758² mod 9 =
2.Easy
0123456789mod 10

Find (−103) mod 10, the remainder r with 0 ≤ r < 10.

a = −103n = 10
(−103) mod 10 =
3.Medium

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

n = 875 = 53·7
φ(875) =
4.Medium

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

a = 31n = 59
31−1 mod 59 =
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

19 is prime. Use Fermat’s little theorem to find 442540 mod 19.

p = 19k = 42540
442540 mod 19 =

Answer key

  1. 1. 758² mod 9 = 4
  2. 2. (−103) mod 10 = 7
  3. 3. φ(875) = 600
  4. 4. 31−1 mod 59 = 40
  5. 5. d = 59
  6. 6. 442540 mod 19 = 11

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