Steply

Calculate 6^25 mod 7

Step by step, with the reason for every step · Powers mod n, last digits · Discrete Math

Step by step

The question

Question: find 6²⁵ mod 7.

625 mod 7

6 to the power 25 has 20 digits.

Too big to work out by hand.

625 has 20 digits!

1 Small powers first

Let's make a table of small powers.

Each one is the one before times 6.

We only keep the remainder: the big part never matters.

only the remainder matters

6 to the 1 is 6.

6
6

Then 6 times 6 is 36.

6 × 6 = 36

36 mod 7 is 1.

And so on.

1
1 × 6 = 6
6

2 Find the pattern

At k = 3 we are back to 6.

From here everything repeats.

So the pattern 6, 1 repeats every 2 powers.

repeats every 2: 6, 1, 6, 1, ...

3 Where 25 lands

25 divided by 2: 12 full patterns, and 1 left over.

25 = 2 × 12 + 1

Careful!

The pattern is all we need.

The full number is far too big.

Careful: never work out 6²⁵ itself

So 6 to the 25 is like k = 1.

So 6²⁵ mod 7 is 6.

625 mod 7 = 6

4 Check

A computer can work out all 20 digits: 284302, and so on, 1376.

computer: 625 = 284302...1376

Divided by 7, it leaves 6, the same as our pattern.

Right!

÷ 7: remainder 6

Let's look back.

First: small powers first.

Then: find the pattern.

Then: where 25 lands.

Last: check.

Answer
625 mod 7 = 6

Your turn

Try this one yourself, then check:

538 mod 7
Show the answer
5³⁸ mod 7 = 4

More from Powers mod n, last digits

The whole lesson: Powers mod n, last digits →