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
aqbr264=?·162+??=?·?+??=?·?+??=?·?+??=?·?+??=?·?+?

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

a = 264b = 162
lcm(264, 162) =
2.Easy
aqbr429=?·154+??=?·?+??=?·?+??=?·?+??=?·?+?

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

a = 429b = 154
lcm(429, 154) =
3.Medium

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

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

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

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

Use repeated squaring to find 1294 mod 41.

a = 12k = 94n = 41
1294 mod 41 =
6.Hard
mc = me​ mod n23m = cd​ mod n?(n, e) = (85, 11)d

An RSA key uses p = 5, q = 17 and e = 11. Decrypt the ciphertext c = 23: find the message m.

p = 5q = 17e = 11c = 23
m =

Answer key

  1. 1. lcm(264, 162) = 7128
  2. 2. lcm(429, 154) = 6006
  3. 3. 12−1 mod 53 = 31
  4. 4. 46−1 mod 71 = 17
  5. 5. 1294 mod 41 = 33
  6. 6. m = 12

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