Steply

Remainder when 4^1000 is divided by 7

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

Step by step

The question

Question: find 4¹⁰⁰⁰ mod 7.

41000 mod 7

4 to the power 1000 has 603 digits.

Too big to work out by hand.

41000 has 603 digits!

1 Small powers first

Let's make a table of small powers.

Each one is the one before times 4.

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

only the remainder matters

4 to the 1 is 4.

4
4

Then 4 times 4 is 16.

4 × 4 = 16

16 mod 7 is 2.

And so on.

2
2 × 4 = 8
1
1 × 4 = 4
4

2 Find the pattern

At k = 4 we are back to 4.

From here everything repeats.

So the pattern 4, 2, 1 repeats every 3 powers.

repeats every 3: 4, 2, 1, 4, 2, 1, ...

3 Where 1000 lands

1000 divided by 3: 333 full patterns, and 1 left over.

1000 = 3 × 333 + 1

Careful!

The pattern is all we need.

The full number is far too big.

Careful: never work out 4¹⁰⁰⁰ itself

So 4 to the 1000 is like k = 1.

So 4¹⁰⁰⁰ mod 7 is 4.

41000 mod 7 = 4

4 Check

A computer can work out all 603 digits: 114813, and so on, 9376.

computer: 41000 = 114813...9376

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

Right!

÷ 7: remainder 4

Let's look back.

First: small powers first.

Then: find the pattern.

Then: where 1000 lands.

Last: check.

Answer
41000 mod 7 = 4

Your turn

Try this one yourself, then check:

358 mod 7
Show the answer
3⁵⁸ mod 7 = 4

More from Powers mod n, last digits

The whole lesson: Powers mod n, last digits →