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
aqbr574=?·182+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(574, 182).

a = 574b = 182
gcd(574, 182) =
2.Easy
012mod 3

Find 869 mod 3, the remainder r with 0 ≤ r < 3.

a = 869n = 3
869 mod 3 =
3.Medium

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

a = 34n = 65
34−1 mod 65 =
4.Medium

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

a = 26n = 35
26−1 mod 35 =
5.Hard
392c = me​ mod n?m = cd​ mod nm(n, e) = (799, 7)d

Encrypt the message m = 392 with the RSA public key (n, e) = (799, 7). Find the ciphertext c.

n = 799e = 7m = 392
c =
6.Hard
308c = me​ mod n?m = cd​ mod nm(n, e) = (989, 17)d

Encrypt the message m = 308 with the RSA public key (n, e) = (989, 17). Find the ciphertext c.

n = 989e = 17m = 308
c =

Answer key

  1. 1. gcd(574, 182) = 14
  2. 2. 869 mod 3 = 2
  3. 3. 34−1 mod 65 = 44
  4. 4. 26−1 mod 35 = 31
  5. 5. c = 596
  6. 6. c = 854

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