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 385² mod 12 without multiplying out the large numbers: reduce first.

n = 12
385² mod 12 =
2.Easy

Find (36·211 + 380) mod 13 without multiplying out the large numbers: reduce first.

n = 13
(36·211 + 380) mod 13 =
3.Medium

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

n = 1125 = 32·53
φ(1125) =
4.Medium

Find the smallest positive integer x with x ≡ 2 (mod 3) and x ≡ 0 (mod 5).

x ≡ 2 (mod 3)x ≡ 0 (mod 5)
x =
5.Hard
589c = me​ mod n?m = cd​ mod nm(n, e) = (1363, 5)d

Encrypt the message m = 589 with the RSA public key (n, e) = (1363, 5). Find the ciphertext c.

n = 1363e = 5m = 589
c =
6.Hard

23 is prime. Use Fermat’s little theorem to find 1463869 mod 23.

p = 23k = 63869
1463869 mod 23 =

Answer key

  1. 1. 385² mod 12 = 1
  2. 2. (36·211 + 380) mod 13 = 7
  3. 3. φ(1125) = 600
  4. 4. x = 5
  5. 5. c = 1281
  6. 6. 1463869 mod 23 = 7

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