100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

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.

mediumQ116 of 225 in Aptitude Est. time: 5 minsLast updated:
Open Code Lab
116 / 225

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

Step-by-Step Explanation

  1. Step 1

    Isolate the base unit digit

    Only the last digit of the base affects the unit digit of the power.

  2. Step 2

    Find the cyclicity

    0,1,5,6 โ†’ cycle 1; 4,9 โ†’ cycle 2; 2,3,7,8 โ†’ cycle 4.

  3. Step 3

    Reduce the exponent

    Compute r = n mod cycle-length; if r = 0, use the cycle-length itself.

  4. 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.

1 / 4

Continue Learning