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 (733·339 + 334) mod 8 without multiplying out the large numbers: reduce first.

n = 8
(733·339 + 334) mod 8 =
2.Easy
aqbr40=?·24+??=?·?+??=?·?+?

Find the least common multiple lcm(40, 24). Use Euclid’s algorithm for the gcd first.

a = 40b = 24
lcm(40, 24) =
3.Medium

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

n = 147 = 3·72
φ(147) =
4.Medium

Find the smallest positive integer x with x ≡ 4 (mod 7) and x ≡ 3 (mod 8).

x ≡ 4 (mod 7)x ≡ 3 (mod 8)
x =
5.Hard

73 is prime. Use Fermat’s little theorem to find 1154065 mod 73.

p = 73k = 54065
1154065 mod 73 =
6.Hard
440c = me​ mod n?m = cd​ mod nm(n, e) = (493, 3)d

Encrypt the message m = 440 with the RSA public key (n, e) = (493, 3). Find the ciphertext c.

n = 493e = 3m = 440
c =

Answer key

  1. 1. (733·339 + 334) mod 8 = 5
  2. 2. lcm(40, 24) = 120
  3. 3. φ(147) = 84
  4. 4. x = 11
  5. 5. 1154065 mod 73 = 42
  6. 6. c = 9

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