DIGIT PROBLEMS
Techniques for exploiting the decimal representation of integers — digit sums, reversals, counting digit-constrained numbers, trailing zeros, and units-digit patterns.
Overview
Every positive integer has a decimal representation — a sequence of digits from 0 to 9. Many AMC 10 problems hide their key insight inside that representation: two numbers whose digits are swapped, a factorial whose last few digits are all zero, or a huge expression whose units digit cycles. Learning to think about digits as separate objects — not just pieces of a number — unlocks these problems quickly.
The central bridge between digits and divisibility is the mod 9 connection: a number's digit sum is congruent to the number itself modulo 9 (and modulo 3). This turns questions about large numbers into tiny arithmetic. A second recurring theme is digit reversal: swapping the tens and units digits of changes the value by , giving a clean linear equation.
AMC 10 problems use digit ideas in four main ways: (1) digit-sum divisibility tests, (2) "the number minus its reversal" style algebra, (3) counting integers satisfying digit constraints (stars-and-bars), and (4) trailing-zero and units-digit pattern problems. Mastering each pattern as a template lets you identify which tool fits in under 30 seconds.
Key facts
- Digit sum and mod 9: For any non-negative integer , and , where is the sum of digits. Use: quickly test divisibility by 3 or 9 without dividing.
- Digit sum and mod 11 (alternating): (alternate signs from right). Use: divisibility-by-11 test.
- Reversal formula: For a two-digit number , reversing gives , so the difference is . Use: set up an equation when a problem mentions "the reversed number."
- Trailing zeros of : Equal (count factors of 5, since factors of 2 are always more plentiful). Use: "how many zeros at the end of " questions.
- Units-digit patterns: The units digit of depends only on the units digit of and on , where is the period of that base's units-digit cycle. Periods mod 10: digits 0,1,5,6 → period 1; digit 4 → period 2; digit 9 → period 2; digits 2,3,7,8 → period 4. Use: units-digit questions with large .
- Counting integers with a digit-sum constraint: Use stars-and-bars on the digits, remembering to enforce upper bounds ( per digit) with inclusion-exclusion. Use: "how many -digit numbers have digit sum " questions.
Worked example 1
A two-digit number is 4 less than 5 times the sum of its digits. Find all such numbers.
Let the number be with .
The condition is , which simplifies to
Rearranging: , so must be a positive multiple of 5. Since we need , i.e., . Testing multiples of 5: gives , . No other value of makes a positive multiple of 5. The number is .
Check: digit sum ; . ✓
Takeaway: Translate the English condition into a linear equation in the digits, then scan small integer values.
Worked example 2
How many three-digit positive integers have a digit sum equal to 8?
We need with and .
Substitute : the equation becomes with each variable in .
Unrestricted stars-and-bars: solutions.
Subtract violations: any variable would require the sum of the other two to be , impossible. So no subtraction needed.
Answer: three-digit integers.
Takeaway: Shift so all lower bounds are 0, apply , then use inclusion-exclusion to remove any solutions exceeding the upper bound of 9.
Common traps
- Forgetting that the leading digit is at least 1. Always shift so the new variable starts at 0; failure to do so overcounts numbers with leading digit 0.
- Applying the mod-9 rule to compute exact values. Knowing tells you only the remainder, not itself. Combine with other constraints to pin down the value.
- Off-by-one in trailing-zero count. Use Legendre's formula: — don't stop after the first term if .
- Assuming the reversal difference is always positive. The formula can be negative if ; set up or track the sign carefully.
- Including 0 as a leading digit when counting multi-digit numbers. A "three-digit number" has its hundreds digit from 1 to 9, not 0 to 9.