How many nonnegative integers can be written in the form
where for ?
Problem 212
Official solutions — 2
Solution 1
This looks like balanced ternary, in which all the integers with absolute values less than are represented in digits. There are 8 digits. Plugging in 8 into the formula for the balanced ternary gives a maximum bound of , which means there are 3280 positive integers, 0, and 3280 negative integers. Since we want all nonnegative integers, there are integers or .
Solution 2
1. We are given the expression:
where for .
2. We need to determine how many distinct nonnegative integers can be formed by this expression.
3. First, note that each has 3 possible values: , , and . Therefore, there are total combinations of the coefficients .
4. To ensure that all these combinations lead to distinct integers, consider the following:
- Suppose two different sets of coefficients, say and , produce the same integer. Let be the largest index where . Without loss of generality, assume .
- The difference between the two representations is:
- The terms from to sum up to a number that is at least:
- Therefore, the whole sum is at least , which contradicts the assumption that the two sets of coefficients produce the same integer. Hence, all combinations lead to distinct integers.
5. Next, we need to count the number of nonnegative integers that can be formed. We use a recurrence relation to solve this problem:
- Let denote the number of nonnegative integers that can be formed using coefficients up to .
- For , the possible values are . Only and are nonnegative, so .
6. For , consider the possible values of :
- If , the sum of the remaining terms can be at most , making the total sum negative.
- If , the problem reduces to the case for , so there are nonnegative values.
- If , the sum of the remaining terms can be at least , making the total sum positive. There are choices here.
7. Therefore, the recurrence relation is:
8. Solving this recurrence relation with :
9. Thus, the number of nonnegative integers that can be written in the given form is .