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
aqbr448=?·152+??=?·?+??=?·?+?

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

a = 448b = 152
lcm(448, 152) =
2.Easy
aqbr75=?·27+??=?·?+??=?·?+??=?·?+?

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

a = 75b = 27
lcm(75, 27) =
3.Medium

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

n = 363 = 3·112
φ(363) =
4.Medium

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

a = 27n = 64
27−1 mod 64 =
5.Hard

How many solutions N does 60x ≡ 30 (mod 78) have in {0, 1, …, 77}?

60x ≡ 30 (mod 78)
N =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (1147, 17)d = ?

An RSA key uses the primes p = 31 and q = 37 and the public exponent e = 17. Find the private exponent d (0 < d < φ(n)).

p = 31q = 37e = 17
d =

Answer key

  1. 1. lcm(448, 152) = 8512
  2. 2. lcm(75, 27) = 675
  3. 3. φ(363) = 220
  4. 4. 27−1 mod 64 = 19
  5. 5. N = 6
  6. 6. d = 953

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