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
aqbr406=?·42+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(406, 42).

a = 406b = 42
gcd(406, 42) =
2.Easy
aqbr663=?·481+??=?·?+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(663, 481).

a = 663b = 481
gcd(663, 481) =
3.Medium

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

a = 4n = 11
4−1 mod 11 =
4.Medium

Find the smallest positive integer x with x ≡ 1 (mod 7) and x ≡ 7 (mod 9).

x ≡ 1 (mod 7)x ≡ 7 (mod 9)
x =
5.Hard
mc = me​ mod n294m = cd​ mod n?(n, e) = (377, 19)d

An RSA key uses p = 13, q = 29 and e = 19. Decrypt the ciphertext c = 294: find the message m.

p = 13q = 29e = 19c = 294
m =
6.Hard

Solve 52x ≡ 44 (mod 54). Give the smallest positive solution x.

52x ≡ 44 (mod 54)
x =

Answer key

  1. 1. gcd(406, 42) = 14
  2. 2. gcd(663, 481) = 13
  3. 3. 4−1 mod 11 = 3
  4. 4. x = 43
  5. 5. m = 122
  6. 6. x = 5

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