How many three-digit numbers satisfy the property that the middle digit is the average of the first and the last digits?
- A)
- B)
- C)
- D)
- E)
Answer
E
Key insight
The middle digit is decided by the other two, and it is a whole number only when the first and last digits are both odd or both even.
Solution
Call the digits , , , so the number is and cannot be . The middle digit must be the average of the other two:
- The middle digit is not a free choice. Once and are picked, is fixed. So we only need to count good pairs .
- When is the average a whole number? When is even. That happens when and are both odd or both even. For example, and average to , but and average to , which is not a digit.
- Is always a real digit? Yes. The average of two digits is between and , so it is never too big.
- Count, both odd. can be ( choices) and can be ( choices): pairs.
- Count, both even. can be ( choices, since cannot be ) and can be ( choices): pairs.
- Total. .
The answer is .
Why this works
"The average is a whole number" is really a question about odd and even: two whole numbers have a whole-number average exactly when they are both odd or both even. Noticing that the middle digit is decided for you turns a three-digit search into a quick count of pairs. A shortcut: for each of the first digits, exactly of the last digits match it, giving .
Alternative approach
Go through the middle digit. For each , count pairs with and :
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
|---|---|---|---|---|---|---|---|---|---|
| pairs | 2 | 4 | 6 | 8 | 9 | 7 | 5 | 3 | 1 |
For example, allows , which is or . The row adds up to .
The trap
Forgetting that the first digit cannot be 0, or thinking the middle digit might be too big, which leads to 50 or some other wrong count.
Concise solution
Call the digits , , with . The condition has two consequences: must be even, and once and are chosen, is fixed. Since and are digits, is automatically between and , so it is always a legal digit.
So we just count pairs with even, i.e. with and of the same parity.
- odd ( choices: ), odd ( choices): pairs.
- even ( choices: ), even ( choices: ): pairs.
Total .
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 8: Base Numbers
- Introduction to Counting & Probability, Chapter 1: Counting Is Arithmetic
- Introduction to Number Theory, Chapter 9: Base Number Arithmetic
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques
Techniques
Use an invariant, parity, or coloring argument