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

Find (508·768) mod 5 without multiplying out the large numbers: reduce first.

n = 5
(508·768) mod 5 =
2.Easy
aqbr138=?·36+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(138, 36).

a = 138b = 36
gcd(138, 36) =
3.Medium

Find the smallest positive integer x with x ≡ 2 (mod 7) and x ≡ 4 (mod 10).

x ≡ 2 (mod 7)x ≡ 4 (mod 10)
x =
4.Medium

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

n = 1625 = 53·13
φ(1625) =
5.Hard

How many solutions N does 18x ≡ 26 (mod 50) have in {0, 1, …, 49}?

18x ≡ 26 (mod 50)
N =
6.Hard
mc = me​ mod n465m = cd​ mod n?(n, e) = (1189, 3)d

An RSA key uses p = 29, q = 41 and e = 3. Decrypt the ciphertext c = 465: find the message m.

p = 29q = 41e = 3c = 465
m =

Answer key

  1. 1. (508·768) mod 5 = 4
  2. 2. gcd(138, 36) = 6
  3. 3. x = 44
  4. 4. φ(1625) = 1200
  5. 5. N = 2
  6. 6. m = 407

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