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
aqbr494=?·65+??=?·?+??=?·?+??=?·?+?

Find the least common multiple lcm(494, 65). Use Euclid’s algorithm for the gcd first.

a = 494b = 65
lcm(494, 65) =
2.Easy
012mod 3

Find 694 mod 3, the remainder r with 0 ≤ r < 3.

a = 694n = 3
694 mod 3 =
3.Medium

Find the inverse of 24 modulo 29: the number x with 0 < x < 29 and 24·x ≡ 1 (mod 29).

a = 24n = 29
24−1 mod 29 =
4.Medium

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

n = 578 = 2·172
φ(578) =
5.Hard
967c = me​ mod n?m = cd​ mod nm(n, e) = (1517, 11)d

Encrypt the message m = 967 with the RSA public key (n, e) = (1517, 11). Find the ciphertext c.

n = 1517e = 11m = 967
c =
6.Hard

How many solutions N does 26x ≡ 28 (mod 68) have in {0, 1, …, 67}?

26x ≡ 28 (mod 68)
N =

Answer key

  1. 1. lcm(494, 65) = 2470
  2. 2. 694 mod 3 = 1
  3. 3. 24−1 mod 29 = 23
  4. 4. φ(578) = 272
  5. 5. c = 1260
  6. 6. N = 2

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