2019 AMC 10B Problem 12
What is the greatest possible sum of the digits in the base-seven representation of a positive integer less than ?
Show solution without answering
Key insight
Numbers below 2019 have at most four base-7 digits, each at most 6. Check whether the smallest number with each high digit sum still fits under 2019.
Solution
In base seven the place values are , and each digit is between and .
1. How many digits? is bigger than . So every number below uses at most four base-seven digits: the s, s, s and s places.
2. Highest sum imaginable. Four digits, each at most , sum to at most . The only number with digit sum is , too big.
3. Can the sum be ? Four digits, each at most , adding to must be three s and one . The smallest such number puts the in front:
That is more than , and the other arrangements are even larger. So is impossible.
4. Sum works. Lower the front digit to :
which is less than . Its digit sum is .
Sum is possible, and sums and are not, so the greatest is .
The answer is .
Why this works
To make a digit sum big, you want big digits, but the number must stay under the limit. So work down from the largest sum you can imagine and, for each candidate sum, test the smallest number that has it. If even the smallest is too big, that sum is out. It helps to know that : its leading digit is followed by small digits, so dropping the leading digit to frees the rest to be s.
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
Since , every positive integer below has at most four base-seven digits, each at most . So the digit sum is at most , attained only by , which is too large.
A digit sum of would need four digits totaling with each at most , so the digits must be in some order. The smallest such number is
So is impossible.
A digit sum of is achievable:
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 8: Base Numbers
- Introduction to Number Theory, Chapter 9: Base Number Arithmetic
- Introduction to Number Theory, Chapter 6: Special Numbers (§6.5)
Similar problems
Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.