A number is called special if it does not contain the digit zero and, in addition, the sum of its digits is equal to twice the first digit. For example, the number 8161 is special because:

- none of its digits is zero;
- the sum of all its digits is $8+1+6+1=16$;
- the double of its first digit is $8 \times 2=16$.

a) Is there a special number with five digits that is even? Why or why not? If it exists, give an example.

b) What is the smallest special number with four digits?

c) What is the largest special number?

d) What is the largest special number that has all distinct digits?
Solution

a) They exist. For example, the number 51112 is special, as zero does not appear among its digits, and, moreover, the double of its first digit is $2 \times 5=10$, equal to the sum of its digits, given by $5+1+1+1+2=10$.

b) The largest special number is 9111111111. No other number larger than it can be special, let's see why. If we have another special number also with 10 digits (9111111111 has 10 digits) larger than 9111111111, this number would have some different digit. The first digit 9 cannot be, because 9 is the largest digit. If any other is different, the sum of its digits would be greater than 18. Therefore, there is no 10-digit number larger than 9111111111.

If a number has more than 10 digits, all different from zero, then the sum of its digits is greater than 10. Therefore, the sum of its digits cannot be double any digit. Thus, we conclude that 9111111111 is the largest special number.

c) The smallest special number of four digits is 3111. No other number $ABCD$ of four digits, smaller than it, could be special, because the sum of its last digits, $A+B+C+D$ would be greater than or equal to 4. Therefore, the first digit $A$ is greater than or equal to 2. If we had $A=2$, then we would have $2+B+C+D=4$, and therefore $B+C+D=2$, which is impossible, as no digit is zero.

d) Note that if two numbers have different quantities of digits, then the larger of them is always the one with more digits. Therefore, we will start by looking for the largest possible quantity of digits.

Saying that double the first digit is equal to the sum of all the digits is the same as saying that the first digit is equal to the sum of the remaining digits. Since $1+2+3+4=10$, no special number with all distinct digits can have five digits, as the sum of the last four would be greater than 9, the largest possible digit. Therefore, we can only look for special numbers with fewer than five digits.

We will choose the first digit as the largest possible. Therefore, it must be 9. The three remaining digits must be distinct and sum to 9. Therefore, the number will be of the form $9BCD$, with $B+C+D=9$. To make $B$ as large as possible, we choose $B=6$ (if $B$ is larger than this, there is no way to find $C$ and $D$). Therefore, we will have $C+D=3$. Choosing $C$ as the largest possible, we will have $C=2$ and thus $D=1$. Therefore, the largest special number with all distinct digits is 9621.