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
aqbr885=?·840+??=?·?+??=?·?+??=?·?+?

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

a = 885b = 840
gcd(885, 840) =
2.Easy
aqbr174=?·33+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(174, 33).

a = 174b = 33
gcd(174, 33) =
3.Medium

Solve 12x ≡ 5 (mod 35). Give the solution x with 0 < x < 35.

12x ≡ 5 (mod 35)
x =
4.Medium

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

a = 7n = 11
7−1 mod 11 =
5.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (65, 11)d = ?

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

p = 5q = 13e = 11
d =
6.Hard
mc = me​ mod n106m = cd​ mod n?(n, e) = (215, 19)d

An RSA key uses p = 5, q = 43 and e = 19. Decrypt the ciphertext c = 106: find the message m.

p = 5q = 43e = 19c = 106
m =

Answer key

  1. 1. gcd(885, 840) = 15
  2. 2. gcd(174, 33) = 3
  3. 3. x = 15
  4. 4. 7−1 mod 11 = 8
  5. 5. d = 35
  6. 6. m = 141

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