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 (620·419) mod 6 without multiplying out the large numbers: reduce first.

n = 6
(620·419) mod 6 =
2.Easy
aqbr825=?·195+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(825, 195).

a = 825b = 195
gcd(825, 195) =
3.Medium

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

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

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

n = 15 = 3·5
φ(15) =
5.Hard

47 is prime. Use Fermat’s little theorem to find 2773182 mod 47.

p = 47k = 73182
2773182 mod 47 =
6.Hard
mc = me​ mod n2m = cd​ mod n?(n, e) = (221, 11)d

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

p = 13q = 17e = 11c = 2
m =

Answer key

  1. 1. (620·419) mod 6 = 4
  2. 2. gcd(825, 195) = 15
  3. 3. x = 51
  4. 4. φ(15) = 8
  5. 5. 2773182 mod 47 = 4
  6. 6. m = 59

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