Lesson 4 of 9 · Number Theory
Units Digits & Base Representation
Two applications of the same underlying idea: a number's digits depend entirely on remainders. The units digit is just the number mod 10, and a base-b representation is nothing but repeated division with remainder. Both turn questions about impossibly large numbers into small, quick computations.
Mark your status for this lesson:
Learning objectives
- Find the units digit of a large power using its short repeating cycle.
- Handle sums and products of large powers by tracking each term's units digit separately.
- Convert fluently between base 10 and any other base, including hexadecimal.
- Solve for an unknown base, and verify the result is valid given the digits used.
The core idea
The units digit of a number is exactly that number mod 10 — so every units-digit question is a modular arithmetic question in disguise. Powers of any fixed base have units digits that cycle with a short period (1, 2, or 4), so finding a huge power's last digit means reducing the exponent mod the cycle length, never computing the power itself.
Base representation is the same idea generalized: writing n in base b means expressing n as a sum of powers of b, where each digit is a remainder from repeated division. Every digit must be strictly less than the base — that constraint is what makes "solve for the base" problems solvable.
Units-digit cycles
Only the base’s own units digit matters. The cycles of units digits as the exponent grows:
| Last digit of the base | Cycle of units digits | Length L |
|---|---|---|
| 0 | 0 | 1 |
| 1 | 1 | 1 |
| 2 | 2, 4, 8, 6 | 4 |
| 3 | 3, 9, 7, 1 | 4 |
| 4 | 4, 6 | 2 |
| 5 | 5 | 1 |
| 6 | 6 | 1 |
| 7 | 7, 9, 3, 1 | 4 |
| 8 | 8, 4, 2, 6 | 4 |
| 9 | 9, 1 | 2 |
The steps
- Keep only the base’s units digit.
- Find its cycle length L (1, 2 or 4) from the table.
- Reduce the exponent mod L.
- Read that term of the cycle. A remainder of 0 means the last term of the cycle, not the first.
Reducing the exponent mod 4 always works, because 1, 2 and 4 all divide 4.
Pitfalls. Using the whole base instead of its units digit, and reading remainder 0 as “the first term” of the cycle.
Base-b representation
(dₖdₖ₋₁⋯d₁d₀)_b = dₖbᵏ + dₖ₋₁bᵏ⁻¹ + ⋯ + d₁b + d₀
Every digit dᵢ satisfies 0 ≤ dᵢ < b.
Base b to base 10
Expand by place values bᵏ as in the formula, or use Horner’s method: start with the leading digit; then repeatedly multiply by b and add the next digit. This is the expansion with b factored out step by step.
Base 10 to base b
- Divide n by b and record the remainder.
- Replace n by the quotient.
- Repeat until the quotient is 0.
- Read the remainders from last to first.
Why it works. Because n = b·(quotient) + digit, each remainder is the digit in the current place, and the quotient carries the higher places.
Solving for the base. The base must be larger than every digit used. Set the place-value expansion equal to the known value and solve for b, then check that b exceeds all the digits.
Power towers
For a tower a^(b^c), work top-down: never evaluate the tower itself.
- Reduce the top exponent first. Find b^c mod L, where L is the cycle length of a’s units digit (usually 4). This is its own small question: for L = 4, an even b with c ≥ 2 gives 0, and an odd b gives 1 or 3.
- Use that remainder as the exponent of the units-digit cycle, remembering that remainder 0 means the last term.
Worked example 1 — Units digit of a large power
Problem
Find the units digit of 8²⁰²⁵.
Key insight
The units digits of powers of 8 cycle with period 4: 8, 4, 2, 6.
Solution
2025 mod 4 = 1, which matches the first entry in the cycle. Units digit: 8.
Takeaway
When the reduced exponent is 0, use the last entry in the cycle, not the first — that's the most common slip here.
Worked example 2 — Converting to another base
Problem
Write 87 in base 4.
Key insight
Divide repeatedly by 4 and read the remainders from bottom to top.
Solution
87 = 21(4) + 3, 21 = 5(4) + 1, 5 = 1(4) + 1, 1 = 0(4) + 1. Reading remainders upward: 1113₄.
Takeaway
Verify by converting back: 1(64) + 1(16) + 1(4) + 3 = 87. Always worth the five seconds.
Worked example 3 — Units digit of a sum
Problem
Find the units digit of 3¹⁰⁰ + 2¹⁰⁰.
Key insight
Find each term's units digit independently, then add and take the units digit of the result.
Solution
Powers of 3 cycle 3,9,7,1 and 100 mod 4 = 0, so 3¹⁰⁰ ends in 1. Powers of 2 cycle 2,4,8,6, so 2¹⁰⁰ ends in 6. 1 + 6 = 7 — units digit 7.
Takeaway
Never add the full numbers. Units digits combine independently under addition and multiplication.
Worked example 4 — Solving for an unknown base
Problem
In some base b, 52_b = 32 in base 10. Find b.
Key insight
Expand the base-b expression algebraically, then solve the resulting equation.
Solution
5b + 2 = 32 → 5b = 30 → b = 6. Check validity: the digits used are 5 and 2, both less than 6, so base 6 is legitimate.
Takeaway
Always confirm the base exceeds every digit used — a solved value that's too small is not a valid answer.
Strategy notes
Only the base's units digit matters
The units digit of 13⁴⁷ is identical to that of 3⁴⁷ — everything above the ones place is irrelevant. Strip the base down to its last digit before doing anything else.
Reducing the exponent mod 4 always suffices for units digits
Every units-digit cycle has length 1, 2, or 4 — all of which divide 4 — so reducing the exponent mod 4 works universally, even when the actual cycle is shorter.
Common mistakes
Using the first cycle entry when the reduced exponent is 0
If exponent mod 4 = 0, the answer is the fourth (last) entry in the cycle, not the first — because the cycle is indexed from exponent 1, not 0.
Using a digit greater than or equal to the base
In base b, every digit must be strictly less than b. A "solution" like base 4 for the number 57₄ is impossible — 5 and 7 are not valid base-4 digits.
Reading conversion remainders in the wrong order
When converting by repeated division, the first remainder is the last (rightmost) digit. Reading them top-down instead of bottom-up reverses the whole number.
Practice
20 questions across four difficulty tiers, each with a single numeric
answer. For base-conversion questions, enter the digit string as a number
(e.g. 100 for 100 in base 5). Up to three tries per question
before the solution is shown.