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

Use Euclid’s algorithm to find gcd(159, 102).

a = 159b = 102
gcd(159, 102) =
2.Easy
aqbr176=?·60+??=?·?+??=?·?+?

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

a = 176b = 60
lcm(176, 60) =
3.Medium

Solve 26x ≡ 33 (mod 43). Give the solution x with 0 < x < 43.

26x ≡ 33 (mod 43)
x =
4.Medium

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

n = 323 = 17·19
φ(323) =
5.Hard

11 is prime. Use Fermat’s little theorem to find 285172 mod 11.

p = 11k = 85172
285172 mod 11 =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (943, 7)d = ?

An RSA key uses the primes p = 23 and q = 41 and the public exponent e = 7. Find the private exponent d (0 < d < φ(n)).

p = 23q = 41e = 7
d =

Answer key

  1. 1. gcd(159, 102) = 3
  2. 2. lcm(176, 60) = 2640
  3. 3. x = 36
  4. 4. φ(323) = 288
  5. 5. 285172 mod 11 = 4
  6. 6. d = 503

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