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

Use Euclid’s algorithm to find gcd(52, 44).

a = 52b = 44
gcd(52, 44) =
2.Easy
aqbr483=?·294+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(483, 294).

a = 483b = 294
gcd(483, 294) =
3.Medium

Solve 8x ≡ 35 (mod 67). Give the solution x with 0 < x < 67.

8x ≡ 35 (mod 67)
x =
4.Medium

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

a = 28n = 89
28−1 mod 89 =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (247, 23)d = ?

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

p = 13q = 19e = 23
d =
6.Hard

Use repeated squaring to find 4147 mod 52.

a = 41k = 47n = 52
4147 mod 52 =

Answer key

  1. 1. gcd(52, 44) = 4
  2. 2. gcd(483, 294) = 21
  3. 3. x = 63
  4. 4. 28−1 mod 89 = 35
  5. 5. d = 47
  6. 6. 4147 mod 52 = 33

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