Step by step
The question
Question: find 2⁵⁰ mod 7.
2 to the power 50 has 16 digits.
Too big to work out by hand.
1 Small powers first
Let's make a table of small powers.
Each one is the one before times 2.
We only keep the remainder: the big part never matters.
2 to the 1 is 2.
Then 2 times 2 is 4.
4 mod 7 is 4.
And so on.
2 Find the pattern
At k = 4 we are back to 2.
From here everything repeats.
So the pattern 2, 4, 1 repeats every 3 powers.
3 Where 50 lands
50 divided by 3: 16 full patterns, and 2 left over.
Careful!
The pattern is all we need.
The full number is far too big.
So 2 to the 50 is like k = 2.
So 2⁵⁰ mod 7 is 4.
4 Check
A computer can work out all 16 digits: 112589, and so on, 2624.
Divided by 7, it leaves 4, the same as our pattern.
Right!
Let's look back.
First: small powers first.
Then: find the pattern.
Then: where 50 lands.
Last: check.