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
aqbr53=?·20+??=?·?+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(53, 20).

a = 53b = 20
gcd(53, 20) =
2.Easy
aqbr288=?·81+??=?·?+??=?·?+??=?·?+?

Use Euclid’s algorithm to find gcd(288, 81).

a = 288b = 81
gcd(288, 81) =
3.Medium

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

a = 54n = 83
54−1 mod 83 =
4.Medium

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

n = 361 = 192
φ(361) =
5.Hard
mc = me​ mod n207m = cd​ mod n?(n, e) = (1739, 13)d

An RSA key uses p = 37, q = 47 and e = 13. Decrypt the ciphertext c = 207: find the message m.

p = 37q = 47e = 13c = 207
m =
6.Hard

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

54x ≡ 72 (mod 78)
N =

Answer key

  1. 1. gcd(53, 20) = 1
  2. 2. gcd(288, 81) = 9
  3. 3. 54−1 mod 83 = 20
  4. 4. φ(361) = 342
  5. 5. m = 1515
  6. 6. N = 6

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