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
aqbr1272=?·456+??=?·?+??=?·?+??=?·?+??=?·?+?

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

a = 1272b = 456
lcm(1272, 456) =
2.Easy
aqbr312=?·40+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(312, 40).

a = 312b = 40
gcd(312, 40) =
3.Medium

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

n = 88 = 23·11
φ(88) =
4.Medium

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

a = 57n = 97
57−1 mod 97 =
5.Hard

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

p = 47k = 35894
735894 mod 47 =
6.Hard
mc = me​ mod ncm = cd​ mod nm(n, e) = (119, 23)d = ?

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

p = 7q = 17e = 23
d =

Answer key

  1. 1. lcm(1272, 456) = 24168
  2. 2. gcd(312, 40) = 8
  3. 3. φ(88) = 40
  4. 4. 57−1 mod 97 = 80
  5. 5. 735894 mod 47 = 34
  6. 6. d = 71

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