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
012mod 3

Find (−115) mod 3, the remainder r with 0 ≤ r < 3.

a = −115n = 3
(−115) mod 3 =
2.Easy
aqbr855=?·615+??=?·?+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(855, 615).

a = 855b = 615
gcd(855, 615) =
3.Medium

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

n = 33 = 3·11
φ(33) =
4.Medium

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

a = 31n = 56
31−1 mod 56 =
5.Hard

Solve 15x ≡ 65 (mod 80). Give the smallest positive solution x.

15x ≡ 65 (mod 80)
x =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (1247, 19)d = ?

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

p = 29q = 43e = 19
d =

Answer key

  1. 1. (−115) mod 3 = 2
  2. 2. gcd(855, 615) = 15
  3. 3. φ(33) = 20
  4. 4. 31−1 mod 56 = 47
  5. 5. x = 15
  6. 6. d = 619

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