Steply

Calculate 17 mod 5

Step by step, with the reason for every step · Remainders · Discrete Math

Step by step

The question

Question: work out 17 mod 5.

17 mod 5

Mod 5 means: the remainder after dividing by 5.

It is always a whole number from 0 to 4.

mod 5 = the remainder after ÷ 5
always 0 to 4

1 Divide by 5

Divide 17 by 5: 5 goes 3 times, that is 15, and 2 is left over.

17 = 5 × 3 + 2

Careful!

3 is how many times 5 goes in.

Mod asks for what is left over: 2.

Careful: not 17 mod 5 = 3 ✗

2 On the clock

Think of a clock with 5 numbers, 0 to 4.

So 17 mod 5 = 2.

17 mod 5 = 2

3 Check

Multiply back: 5 times 3, plus 2, is 17.

5 × 3 + 2 = 15 + 2 = 17

And 2 is from 0 to 4.

Right!

0 ≤ 2 < 5

Let's look back.

First: divide by 5.

Then: on the clock.

Last: check.

Answer
17 mod 5 = 2

Your turn

Try this one yourself, then check:

20 mod 8
Show the answer
20 mod 8 = 4

More from Remainders

The whole lesson: Remainders →