A number is said to be TOP if it has 5 digits and the product of the $1^{\circ}$ and the $5^{\circ}$ is equal to the sum of the $2^{\circ}, 3^{\circ} \mathrm{and} 4^{\circ}$. For example, 12,338 is TOP, because it has 5 digits and $1 \cdot 8=2+3+3$.

a) What is the value of $a$ so that $23,4 a 8$ is TOP?

b) How many TOP numbers end with 2 and start with 1?

c) How many TOP numbers start with 9?
Solution

a) We have that $2 \cdot 8 = 3 + 4 + a$, so $a = 9$.

b) Let $1 b . c d 2$ be a TOP number. We have that $b + c + d = 2$, and all the possible combinations $(b, c, d)$ are $(0,0,2), (0,1,1), (0,2,0), (1,0,1), (1,1,0), (2,0,0)$, which means there are 6 TOP numbers.

c) Let 9e.fgh be a TOP number. We will analyze all cases starting with the possible values of $h$:

I) If $h = 0$, then $e + f + g = 0$, whose only possibility is $(0,0,0)$.

II) If $h = 1$, then $e + f + g = 9$, that is, for $e = 0$, there are 10 possibilities for $f$ (from 0 to 9) and $g$ is determined; for $e = 1$, there are 9 possibilities for $f$ and $g$ is determined; for $e = 2$, there are 8 possibilities for $f$; and so on until $e = 9$ and 1 possibility for $f$, so the total number of possibilities for $h = 1$ is $10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 = 55$.

III) If $h = 2$, then $e + f + g = 18$, that is, for $e = 0$, there is only one combination for $f$ and $g$, which is $f = g = 9$; for $e = 1$, there are 2 possibilities for $f$ and $g$; for $e = 2$, there are 3 possibilities; for $e = 3$, there are 4 possibilities; and so on until $e = 9$, which are 10 possibilities. In this case, we have $1 + 2 + 3 + 4 + \ldots + 10 = 55$ possibilities.

IV) If $h = 3$, then $e + f + g = 27$, which has only the solution $e = f = g = 9$.

V) If $h > 3$, there is no TOP number.

Therefore, the total number of TOP numbers that start with 9 is $1 + 55 + 55 + 1 = 112$.