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
aqbr456=?·408+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(456, 408).

a = 456b = 408
gcd(456, 408) =
2.Easy
aqbr595=?·204+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(595, 204).

a = 595b = 204
gcd(595, 204) =
3.Medium

Find the smallest positive integer x with x ≡ 5 (mod 6) and x ≡ 6 (mod 11).

x ≡ 5 (mod 6)x ≡ 6 (mod 11)
x =
4.Medium

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

a = 52n = 83
52−1 mod 83 =
5.Hard
mc = me​ mod n148m = cd​ mod n?(n, e) = (1457, 17)d

An RSA key uses p = 31, q = 47 and e = 17. Decrypt the ciphertext c = 148: find the message m.

p = 31q = 47e = 17c = 148
m =
6.Hard

11 is prime. Use Fermat’s little theorem to find 2998024 mod 11.

p = 11k = 98024
2998024 mod 11 =

Answer key

  1. 1. gcd(456, 408) = 24
  2. 2. gcd(595, 204) = 17
  3. 3. x = 17
  4. 4. 52−1 mod 83 = 8
  5. 5. m = 858
  6. 6. 2998024 mod 11 = 3

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