How many of the first 2017 positive integers can be uniquely represented as , with , , non-negative integers? (Two representations that only differ by the order of the terms are considered identical.)
Solution
If a number can be represented as a sum of three, not necessarily distinct, powers of , regrouping the equal terms (if such terms exist), one obtains a sum of at most three distinct powers of , hence the base representation of such a number has at most three digits equal to . Convenient numbers are those whose base representation have three digits equal to , then the numbers of the form with (numbers with are not convenient because ); finally, the numbers are also convenient if .
Let us count first the convenient numbers that are less than . The base representation of these numbers has at most digits. There are numbers less than that can be written as a sum of three distinct powers of . There are numbers of the form , and of the form , hence numbers in total.
The numbers from to are larger than , hence their base representation has more than three digits equal to , therefore none of these numbers is convenient. In conclusion, there are convenient numbers among the first .