Steply

Calculate -20 mod 6

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

Step by step

The question

Question: work out −20 mod 6.

−20 mod 6

Mod 6 means: the remainder after dividing by 6.

It is always a whole number from 0 to 5.

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

1 Divide by 6

Divide −20 by 6.

For a negative number we go down to the multiple of 6 just below it: 6 × (−4) = −24.

Then up 4.

−20 = 6 × (−4) + 4

Careful!

A remainder is never negative.

We go down to the multiple just below, then count up.

Careful: not −20 mod 6 = −2 ✗

2 On the clock

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

So −20 mod 6 = 4.

−20 mod 6 = 4

3 Check

Multiply back: 6 times (−4), plus 4, is −20.

6 × (−4) + 4 = −24 + 4 = −20

And 4 is from 0 to 5.

Right!

0 ≤ 4 < 6

Let's look back.

First: divide by 6.

Then: on the clock.

Last: check.

Answer
−20 mod 6 = 4

Your turn

Try this one yourself, then check:

−17 mod 3
Show the answer
−17 mod 3 = 1

More from Remainders

The whole lesson: Remainders →