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
aqbr1155=?·756+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(1155, 756).

a = 1155b = 756
gcd(1155, 756) =
2.Easy
0123456789mod 10

Find (−65) mod 10, the remainder r with 0 ≤ r < 10.

a = −65n = 10
(−65) mod 10 =
3.Medium

Solve 18x ≡ 2 (mod 31). Give the solution x with 0 < x < 31.

18x ≡ 2 (mod 31)
x =
4.Medium

Find Euler’s totient φ(363), the number of integers from 1 to 363 that are coprime to 363.

n = 363 = 3·112
φ(363) =
5.Hard

37 is prime. Use Fermat’s little theorem to find 2395054 mod 37.

p = 37k = 95054
2395054 mod 37 =
6.Hard
mc = me​ mod n58m = cd​ mod n?(n, e) = (77, 23)d

An RSA key uses p = 7, q = 11 and e = 23. Decrypt the ciphertext c = 58: find the message m.

p = 7q = 11e = 23c = 58
m =

Answer key

  1. 1. gcd(1155, 756) = 21
  2. 2. (−65) mod 10 = 5
  3. 3. x = 7
  4. 4. φ(363) = 220
  5. 5. 2395054 mod 37 = 11
  6. 6. m = 53

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