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 (660·53 + 476) mod 12 without multiplying out the large numbers: reduce first.

n = 12
(660·53 + 476) mod 12 =
2.Easy
aqbr40=?·22+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(40, 22).

a = 40b = 22
gcd(40, 22) =
3.Medium

Solve 7x ≡ 17 (mod 23). Give the solution x with 0 < x < 23.

7x ≡ 17 (mod 23)
x =
4.Medium

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

n = 143 = 11·13
φ(143) =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (377, 11)d = ?

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

p = 13q = 29e = 11
d =
6.Hard

Use repeated squaring to find 73100 mod 76.

a = 73k = 100n = 76
73100 mod 76 =

Answer key

  1. 1. (660·53 + 476) mod 12 = 8
  2. 2. gcd(40, 22) = 2
  3. 3. x = 9
  4. 4. φ(143) = 120
  5. 5. d = 275
  6. 6. 73100 mod 76 = 73

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