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
aqbr129=?·93+??=?·?+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(129, 93).

a = 129b = 93
gcd(129, 93) =
2.Easy
aqbr221=?·78+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(221, 78).

a = 221b = 78
gcd(221, 78) =
3.Medium

Solve 11x ≡ 56 (mod 74). Give the solution x with 0 < x < 74.

11x ≡ 56 (mod 74)
x =
4.Medium

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

n = 20 = 22·5
φ(20) =
5.Hard
mc = me​ mod n1194m = cd​ mod n?(n, e) = (1271, 17)d

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

p = 31q = 41e = 17c = 1194
m =
6.Hard

83 is prime. Use Fermat’s little theorem to find 1559722 mod 83.

p = 83k = 59722
1559722 mod 83 =

Answer key

  1. 1. gcd(129, 93) = 3
  2. 2. gcd(221, 78) = 13
  3. 3. x = 32
  4. 4. φ(20) = 8
  5. 5. m = 531
  6. 6. 1559722 mod 83 = 77

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