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
aqbr66=?·45+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(66, 45).

a = 66b = 45
gcd(66, 45) =
2.Easy
aqbr80=?·46+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(80, 46).

a = 80b = 46
gcd(80, 46) =
3.Medium

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

a = 5n = 19
5−1 mod 19 =
4.Medium

Find the smallest positive integer x with x ≡ 4 (mod 5) and x ≡ 5 (mod 6).

x ≡ 4 (mod 5)x ≡ 5 (mod 6)
x =
5.Hard
336c = me​ mod n?m = cd​ mod nm(n, e) = (377, 23)d

Encrypt the message m = 336 with the RSA public key (n, e) = (377, 23). Find the ciphertext c.

n = 377e = 23m = 336
c =
6.Hard

Solve 10x ≡ 4 (mod 18). Give the smallest positive solution x.

10x ≡ 4 (mod 18)
x =

Answer key

  1. 1. gcd(66, 45) = 3
  2. 2. gcd(80, 46) = 2
  3. 3. 5−1 mod 19 = 4
  4. 4. x = 29
  5. 5. c = 331
  6. 6. x = 4

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