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
aqbr1044=?·558+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(1044, 558).

a = 1044b = 558
gcd(1044, 558) =
2.Easy

Find (58·432) mod 10 without multiplying out the large numbers: reduce first.

n = 10
(58·432) mod 10 =
3.Medium

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

x ≡ 6 (mod 7)x ≡ 3 (mod 10)
x =
4.Medium

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

n = 343 = 73
φ(343) =
5.Hard

Use repeated squaring to find 13180 mod 97.

a = 13k = 180n = 97
13180 mod 97 =
6.Hard
90c = me​ mod n?m = cd​ mod nm(n, e) = (247, 7)d

Encrypt the message m = 90 with the RSA public key (n, e) = (247, 7). Find the ciphertext c.

n = 247e = 7m = 90
c =

Answer key

  1. 1. gcd(1044, 558) = 18
  2. 2. (58·432) mod 10 = 6
  3. 3. x = 13
  4. 4. φ(343) = 294
  5. 5. 13180 mod 97 = 47
  6. 6. c = 155

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