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 (258·66 + 236) mod 9 without multiplying out the large numbers: reduce first.

n = 9
(258·66 + 236) mod 9 =
2.Easy

Find 665² mod 9 without multiplying out the large numbers: reduce first.

n = 9
665² mod 9 =
3.Medium

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

n = 1715 = 5·73
φ(1715) =
4.Medium

Solve 14x ≡ 61 (mod 67). Give the solution x with 0 < x < 67.

14x ≡ 61 (mod 67)
x =
5.Hard

59 is prime. Use Fermat’s little theorem to find 1423864 mod 59.

p = 59k = 23864
1423864 mod 59 =
6.Hard
mc = me​ mod n557m = cd​ mod n?(n, e) = (629, 13)d

An RSA key uses p = 17, q = 37 and e = 13. Decrypt the ciphertext c = 557: find the message m.

p = 17q = 37e = 13c = 557
m =

Answer key

  1. 1. (258·66 + 236) mod 9 = 2
  2. 2. 665² mod 9 = 1
  3. 3. φ(1715) = 1176
  4. 4. x = 57
  5. 5. 1423864 mod 59 = 57
  6. 6. m = 353

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