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

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

a = 522b = 153
lcm(522, 153) =
2.Easy
aqbr184=?·148+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(184, 148).

a = 184b = 148
gcd(184, 148) =
3.Medium

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

n = 38 = 2·19
φ(38) =
4.Medium

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

a = 37n = 79
37−1 mod 79 =
5.Hard

Solve 30x ≡ 42 (mod 84). Give the smallest positive solution x.

30x ≡ 42 (mod 84)
x =
6.Hard
mc = me​ mod n112m = cd​ mod n?(n, e) = (247, 11)d

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

p = 13q = 19e = 11c = 112
m =

Answer key

  1. 1. lcm(522, 153) = 8874
  2. 2. gcd(184, 148) = 4
  3. 3. φ(38) = 18
  4. 4. 37−1 mod 79 = 47
  5. 5. x = 7
  6. 6. m = 44

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