Asked in about 3% of papers5 real questions available
Goal
Reduce a power by its cycle before you compute it, and read the unit digit from the cycle position.
The unit digits of the powers of a digit repeat. For 3 they are 3, 9, 7, 1, and then the cycle starts again. The cycle length is 4. Divide the exponent by 4 and use the remainder as the position in the cycle. Remainder 1 means the first entry, 2 the second, 3 the third. Remainder 0 means you have finished a whole number of cycles, so you take the last entry, not the first.
: leaves remainder 3, so the unit digit is the third in the cycle, which is 7. ends in 1, and ends in 1, which is the remainder-0 case.
The same idea gives remainders. Replace the base by its remainder before multiplying, and reduce after each step so the numbers stay small.