Steply

Calculate -13 mod 5

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

Step by step

The question

Question: work out −13 mod 5.

−13 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 −13 by 5.

For a negative number we go down to the multiple of 5 just below it: 5 × (−3) = −15.

Then up 2.

−13 = 5 × (−3) + 2

Careful!

A remainder is never negative.

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

Careful: not −13 mod 5 = −3 ✗

2 On the clock

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

So −13 mod 5 = 2.

−13 mod 5 = 2

3 Check

Multiply back: 5 times (−3), plus 2, is −13.

5 × (−3) + 2 = −15 + 2 = −13

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
−13 mod 5 = 2

Your turn

Try this one yourself, then check:

−15 mod 6
Show the answer
−15 mod 6 = 3

More from Remainders

The whole lesson: Remainders →