Skip to main content
OlympiadHQ

Browse · MathNet

Print

XXXIII Cono Sur Mathematical Olympiad

Argentina counting and probability

Problem

A positive integer is happy if all of its digits are different and non-zero, one of its digits is equal to the sum of the others. For example, is a happy number. How many happy numbers are there?
Solution
The largest digit should be equal to the sum of the rest of the digits. We separate in cases according to the value of the largest digit.

Observe that if the largest digit is , then it is the only digit and the number is not happy. In the case that is the largest digit then either it is the only digit or the number also has a digit ; in both cases, the number is not happy. If the largest digit is , we can get as the sum of smaller digits in exactly one way, namely . That is, if the other digits are and the number is happy. We have numbers with the digits , and .

Similarly, since there are happy numbers where is the largest digit.

If is the largest digit, we have and so there are happy numbers ( with the digits , and , and with the digits , and ).

If is the largest digit, we have , and . We have happy numbers with the digits , and , with the digits , and , and with the digits , , and . That is, we have happy numbers with its largest digit equal to .

If is the largest digit, since we have happy numbers.

If is the largest digit, since we have happy numbers.

If is the largest digit, since we have happy numbers.

Therefore, in total there are happy numbers.
Final answer
264

Techniques

Enumeration with symmetry