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
aqbr459=?·99+??=?·?+??=?·?+??=?·?+??=?·?+?

Find the least common multiple lcm(459, 99). Use Euclid’s algorithm for the gcd first.

a = 459b = 99
lcm(459, 99) =
2.Easy
aqbr258=?·192+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(258, 192).

a = 258b = 192
gcd(258, 192) =
3.Medium

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

a = 16n = 53
16−1 mod 53 =
4.Medium

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

a = 43n = 50
43−1 mod 50 =
5.Hard
345c = me​ mod n?m = cd​ mod nm(n, e) = (551, 23)d

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

n = 551e = 23m = 345
c =
6.Hard

Use repeated squaring to find 2056 mod 61.

a = 20k = 56n = 61
2056 mod 61 =

Answer key

  1. 1. lcm(459, 99) = 5049
  2. 2. gcd(258, 192) = 6
  3. 3. 16−1 mod 53 = 10
  4. 4. 43−1 mod 50 = 7
  5. 5. c = 224
  6. 6. 2056 mod 61 = 20

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