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

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

a = 507b = 403
lcm(507, 403) =
2.Easy

Find 209² mod 9 without multiplying out the large numbers: reduce first.

n = 9
209² mod 9 =
3.Medium

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

a = 23n = 61
23−1 mod 61 =
4.Medium

Find Euler’s totient φ(833), the number of integers from 1 to 833 that are coprime to 833.

n = 833 = 72·17
φ(833) =
5.Hard
mc = me​ mod n26m = cd​ mod n?(n, e) = (209, 11)d

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

p = 11q = 19e = 11c = 26
m =
6.Hard

How many solutions N does 9x ≡ 3 (mod 24) have in {0, 1, …, 23}?

9x ≡ 3 (mod 24)
N =

Answer key

  1. 1. lcm(507, 403) = 15717
  2. 2. 209² mod 9 = 4
  3. 3. 23−1 mod 61 = 8
  4. 4. φ(833) = 672
  5. 5. m = 125
  6. 6. N = 3

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