How to Find the Unit Digit of Large Powers
Find the unit digit of any large power using digit cyclicity and modular exponent reduction, with a worked example and practice questions.
Expected Interview Answer
The unit digit of a^n is found by identifying the cyclicity of the baseโs unit digit (a pattern that repeats every 1, 2, or 4 powers) and then computing n mod cycle-length to pick the matching digit from the cycle.
Every digit 0-9 has a unit-digit cycle when raised to increasing powers: digits 0, 1, 5, 6 never change (cycle length 1); 4 and 9 cycle every 2 powers; 2, 3, 7, 8 cycle every 4 powers. To solve a^n, take only the unit digit of a, find its cycle, compute r = n mod cycle-length (using the cycle-length itself when r = 0), and read off the r-th digit in the cycle. This turns an intractable power like 7^123 into a two-step lookup instead of actual exponentiation.
- Avoids computing enormous powers directly
- Works for any exponent, however large
- A fixed 4-digit cyclicity table covers every base
AI Mentor Explanation
A bowler rotates through exactly four fielding positions over and over during an over, so to know where he stands on ball 27 you do not track all 27 balls โ you compute 27 mod 4 = 3 and read the third position in the rotation. Unit digits of powers behave identically: digits like 2, 3, 7, and 8 repeat their last digit every 4 multiplications, so 2^27's unit digit is found the same way, by taking 27 mod 4 and picking from the fixed four-digit cycle 2, 4, 8, 6.
Worked example
Cycle of 7
- 7, 9, 3, 1
- length 4
Exponent mod cycle
- 123 mod 4 = 3
Answer
- 3rd entry = 3
Step-by-Step Explanation
Step 1
Isolate the base unit digit
Only the last digit of the base affects the unit digit of the power.
Step 2
Find the cyclicity
0,1,5,6 โ cycle 1; 4,9 โ cycle 2; 2,3,7,8 โ cycle 4.
Step 3
Reduce the exponent
Compute r = n mod cycle-length; if r = 0, use the cycle-length itself.
Step 4
Read the answer
The r-th power of the base unit digit is the unit digit of a^n.
What Interviewer Expects
- Correct identification of cyclicity per digit
- Correct modular reduction of the exponent
- Handling the r = 0 edge case by using the full cycle length
- Speed โ solving without full exponentiation
Common Mistakes
- Using the whole base instead of just its unit digit
- Forgetting that r = 0 means the last entry of the cycle, not digit 1
- Misremembering cycle length as always 4
- Multiplying out the full power instead of using the cycle
Best Answer (HR Friendly)
โI only care about the last digit of the base, because that is all that determines the unit digit of any power. That digit repeats its unit digit in a short cycle โ length 1, 2, or 4 โ so I compute the exponent modulo that cycle length and read off the matching digit, which avoids ever computing the actual huge power.โ
Follow-up Questions
- How would you find the last two digits of a large power instead of just one?
- Why do digits 0, 1, 5, and 6 always have cycle length 1?
- How does this technique extend to finding the unit digit of a product of several large powers?
- What is the unit digit of a factorial for n โฅ 5, and why?
MCQ Practice
1. What is the unit digit of 2^97?
Cycle of 2 is 2,4,8,6 (length 4). 97 mod 4 = 1, so the answer is the 1st entry: 2.
2. What is the unit digit of 9^45?
Cycle of 9 is 9,1 (length 2). 45 mod 2 = 1, so the answer is the 1st entry: 9.
3. What is the unit digit of 4^100?
Cycle of 4 is 4,6 (length 2). 100 mod 2 = 0, so use the last entry of the cycle: 6.
Flash Cards
Cycle length for 0, 1, 5, 6? โ 1 โ the unit digit never changes.
Cycle length for 4 and 9? โ 2.
Cycle length for 2, 3, 7, 8? โ 4.
What if n mod cycle-length = 0? โ Use the last entry of the cycle, not the first.