As stated in the title
For one digit number there is $1$
For two digit numbers there are $27(=4+(4+5)+(4+5+5)) (sum =5n, n=1,2,3)$ $since (5n<18)$
But I'm struggling to find the ones that are of three digits
$(sum)=5n, n=1,...,4)$$for (5n\leq20)$ (without writing out all the possible combinations).
The possible answers are $18,45,60,61$
Can someone please explain which of the above answers is the most appropriate?
If the first two digits are $0,0$ than the last digit must be $0$ or $5$. There are two such numbers.
If the first two digits are $0,1$ then the last digit must be $4$ or $9$. There are two such number.
If the first two digits are $2$ and $7$ that then last digit must be $1$ and $6$. There are two such numbers.
And so on.
The first two digits are $00$ to $29$, that's $30$ option and there are two options for $c$ so that there are $2*30 = 60$ such numbers. But $000$ is not acceptable so there are $59$.
So, $59$. Final answer.
....
But we must prove that if the first two digits are $a$ and $b$ there are exactly $2$ digits that third digit can be.
=====
ANd... if you add up $a$ and $b$ and take the remainder from dividing be $5$ (call it $r$) there are exactly $5$ possible remainders values of $r$. For $a+b +c$ to be a multiple of $5$ then the remainder $a+b+c$ must be $0$ and the remainder of $c$ must be the opposite $r$. That is if $r=1$ then the remainder of $c$ (call it $s$) must be $4$ and if $r=2$ then $s = 3$ and $r=3$ then $s=2$ and if $r=4$ then $s=1$ and if $r=0$ then $s = 0$.
And there are exactly $5$ possible opposite remainders that $s$ can be. $c$ can be $s+0$ and $s+5$.
....
Putting that argument in terms of
Modular arithmetic: If $a+b \equiv r \pmod 5$ then $c \equiv - r\pmod 5$. As $\{0,1,2,3,4\}$ and $\{5,6,7,8,9\}$ are two complete residue systems there are exactly one representative for $-r$ in each set so there are two option for digit $c$.
.....
Remainder theorem:
Let $a+b = 5K + r$. $a+b+c = 5M + 0$. Then $c= (5M + 0)- (5K+r)=5(M-K)+r$ and $0\le c \le 9$ and $0 \le r \le 4$. If $r=0$ then $0\le c= 5(M-K)\le 9$ so $c=0, 5$. If $0 < r < 5$ then $0\le c = 5(M-k)-r \le 9$ then $c = 5-r$ or $c = 10-r$.