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

Use Euclid’s algorithm to find gcd(748, 357).

a = 748b = 357
gcd(748, 357) =
2.Easy
012345678mod 9

Find 938 mod 9, the remainder r with 0 ≤ r < 9.

a = 938n = 9
938 mod 9 =
3.Medium

Find the smallest positive integer x with x ≡ 5 (mod 7) and x ≡ 10 (mod 12).

x ≡ 5 (mod 7)x ≡ 10 (mod 12)
x =
4.Medium

Solve 17x ≡ 16 (mod 37). Give the solution x with 0 < x < 37.

17x ≡ 16 (mod 37)
x =
5.Hard

Use repeated squaring to find 4051 mod 93.

a = 40k = 51n = 93
4051 mod 93 =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (437, 5)d = ?

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

p = 19q = 23e = 5
d =

Answer key

  1. 1. gcd(748, 357) = 17
  2. 2. 938 mod 9 = 2
  3. 3. x = 82
  4. 4. x = 14
  5. 5. 4051 mod 93 = 70
  6. 6. d = 317

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