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
aqbr120=?·38+??=?·?+??=?·?+?

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

a = 120b = 38
lcm(120, 38) =
2.Easy
0123456789mod 10

Find 544 mod 10, the remainder r with 0 ≤ r < 10.

a = 544n = 10
544 mod 10 =
3.Medium

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

n = 289 = 172
φ(289) =
4.Medium

Find the smallest positive integer x with x ≡ 1 (mod 7) and x ≡ 6 (mod 10).

x ≡ 1 (mod 7)x ≡ 6 (mod 10)
x =
5.Hard

Use repeated squaring to find 83117 mod 89.

a = 83k = 117n = 89
83117 mod 89 =
6.Hard
mc = me​ mod n43m = cd​ mod n?(n, e) = (155, 13)d

An RSA key uses p = 5, q = 31 and e = 13. Decrypt the ciphertext c = 43: find the message m.

p = 5q = 31e = 13c = 43
m =

Answer key

  1. 1. lcm(120, 38) = 2280
  2. 2. 544 mod 10 = 4
  3. 3. φ(289) = 272
  4. 4. x = 36
  5. 5. 83117 mod 89 = 14
  6. 6. m = 148

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