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

Use Euclid’s algorithm to find gcd(98, 60).

a = 98b = 60
gcd(98, 60) =
2.Easy
aqbr840=?·686+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(840, 686).

a = 840b = 686
gcd(840, 686) =
3.Medium

Solve 18x ≡ 50 (mod 61). Give the solution x with 0 < x < 61.

18x ≡ 50 (mod 61)
x =
4.Medium

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

a = 16n = 41
16−1 mod 41 =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (989, 23)d = ?

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

p = 23q = 43e = 23
d =
6.Hard

How many solutions N does 42x ≡ 12 (mod 60) have in {0, 1, …, 59}?

42x ≡ 12 (mod 60)
N =

Answer key

  1. 1. gcd(98, 60) = 2
  2. 2. gcd(840, 686) = 14
  3. 3. x = 57
  4. 4. 16−1 mod 41 = 18
  5. 5. d = 683
  6. 6. N = 6

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