How many distinct four-digit numbers are divisible by and have as their last two digits?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
The 90 numbers 1023, 1123, ..., 9923 go up by 100. Each step changes the remainder after dividing by 3, so every third number works.
Solution
- List the four-digit numbers ending in : . The first two digits run from to , so there are of them.
- Find the first one divisible by . A number is divisible by when its digit sum is. has digit sum , so works.
- See what happens as you go up the list. Each step adds , and where is a multiple of . So each step raises the remainder (when you divide by ) by :
| Number | Digit sum | Divisible by ? |
|---|---|---|
| yes | ||
| no | ||
| no | ||
| yes | ||
| no |
- The pattern yes, no, no repeats all the way up the list. So exactly one out of every three numbers works.
- The list has numbers, which is groups of three, and each group has one number that works. That gives .
The answer is .
Why this works
If you keep adding the same amount, and that amount leaves remainder when divided by , the remainders cycle through all three possibilities in turn. So in any three numbers in a row of the list, exactly one is a multiple of . This turns the question into a single division, and the same idea works for any fixed ending and any divisor.
Alternative approach
Use digit sums. Call the first two digits and . The number is divisible by when is, that is, when is a multiple of . The possible values of go from (for ) to (for ), and the ones that work are . Count two-digit numbers with each digit sum: (just ), (), ( to : numbers), ( to : numbers), ( to : numbers), (: numbers). Total: .
The trap
Counting 100 numbers by letting the first digit be 0, or making a slip in digit-sum casework.
Concise solution
A four-digit number ending in is where is its first two digits, . That is candidates: .
Consecutive candidates differ by , and , so as increases by the residue of mod increases by . The residues therefore cycle , and in any three consecutive candidates exactly one is a multiple of . Since is a multiple of , exactly candidates are divisible by .
Concretely, is the first, and the multiples of are (step ): .
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 12: Introduction to Modular Arithmetic
- Introduction to Counting & Probability, Chapter 1: Counting Is Arithmetic
- Introduction to Number Theory, Chapter 10: Units Digits
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques
Techniques
Set up the equation/formula and compute; no special trick needed