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
aqbr507=?·208+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(507, 208).

a = 507b = 208
gcd(507, 208) =
2.Easy

Find (702·528 + 490) mod 9 without multiplying out the large numbers: reduce first.

n = 9
(702·528 + 490) mod 9 =
3.Medium

Find the smallest positive integer x with x ≡ 2 (mod 5) and x ≡ 10 (mod 11).

x ≡ 2 (mod 5)x ≡ 10 (mod 11)
x =
4.Medium

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

a = 71n = 83
71−1 mod 83 =
5.Hard

Use repeated squaring to find 8119 mod 15.

a = 8k = 119n = 15
8119 mod 15 =
6.Hard
782c = me​ mod n?m = cd​ mod nm(n, e) = (817, 19)d

Encrypt the message m = 782 with the RSA public key (n, e) = (817, 19). Find the ciphertext c.

n = 817e = 19m = 782
c =

Answer key

  1. 1. gcd(507, 208) = 13
  2. 2. (702·528 + 490) mod 9 = 4
  3. 3. x = 32
  4. 4. 71−1 mod 83 = 76
  5. 5. 8119 mod 15 = 2
  6. 6. c = 174

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