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
aqbr403=?·234+??=?·?+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(403, 234).

a = 403b = 234
gcd(403, 234) =
2.Easy
aqbr391=?·119+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(391, 119).

a = 391b = 119
gcd(391, 119) =
3.Medium

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

n = 121 = 112
φ(121) =
4.Medium

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

x ≡ 6 (mod 7)x ≡ 1 (mod 10)
x =
5.Hard
181c = me​ mod n?m = cd​ mod nm(n, e) = (533, 13)d

Encrypt the message m = 181 with the RSA public key (n, e) = (533, 13). Find the ciphertext c.

n = 533e = 13m = 181
c =
6.Hard
566c = me​ mod n?m = cd​ mod nm(n, e) = (697, 17)d

Encrypt the message m = 566 with the RSA public key (n, e) = (697, 17). Find the ciphertext c.

n = 697e = 17m = 566
c =

Answer key

  1. 1. gcd(403, 234) = 13
  2. 2. gcd(391, 119) = 17
  3. 3. φ(121) = 110
  4. 4. x = 41
  5. 5. c = 350
  6. 6. c = 617

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