Question 1
How many three-digit numbers are not divisible by $5$, have digits that sum to less than $20$, and have the first digit equal to the third digit?
Xem đáp án và lời giải
Đáp án: $60$
A three-digit number whose first and third digits agree has the form $\overline{aba}$, where $1 \leqslant a \leqslant 9$ and $0 \leqslant b \leqslant 9$. For $\overline{aba}$ not to be divisible by $5$, we must have $a \ne 5$. The digit-sum condition is $2a + b < 20$, i.e., $b \leqslant 19 - 2a$.
- For $a \in \{1, 2, 3, 4\}$, $19 - 2a \geqslant 11$, so all $10$ digits $b \in \{0, 1, \dots, 9\}$ are valid, giving $4 \cdot 10 = 40$ numbers.
- For $a = 6$, $b \leqslant 7$ ($8$ choices); for $a = 7$, $b \leqslant 5$ ($6$ choices); for $a = 8$, $b \leqslant 3$ ($4$ choices); for $a = 9$, $b \leqslant 1$ ($2$ choices).
In total there are $40 + 8 + 6 + 4 + 2 = 60$ such numbers.