# How many $3$-digit numbers are divisible by $4$?

I want to find out how many numbers can be formed taking the digits from zero to nine without repetition such that they are divisible by four (of 3 digits).

My Work: I find out the number pairs for the ones and ten's places which are divisible by four (like $04, 40, 08, 80, 12, 16,$ etc). These are $22$ in number. For any pair, for the hundred place, I have $8$ digits left (including $0$). So, my rough calculation becomes $8\times 22 = 176$. Then, I find out the number pairs without zero ($16$ in number) .

Thus, my final answer becomes $176 - 16\times 1 = 160$. Am I correct ?

• You are correct if you mean three-digit positive integers. If you mean three-digit strings, you have to account for the possibility that the string begins with $0$. Please clarify what you mean. – N. F. Taussig Jun 24 '18 at 12:29

How many three-digit positive integers with distinct digits are divisible by $4$?

If this was the intended question, then you are indeed correct. Your explanation could be improved if you made clear that you were subtract the $16$ strings with leading digit zero.

For a number to be divisible by $4$, the number formed by its last two digits (appending leading zeros as necessary) must be divisible by $4$.

\begin{array}{c c c c c} \color{red}{00} & \color{blue}{04} & \color{blue}{08} & 12 & 16\\ \color{blue}{20} & 24 & 28 & 32 & 36\\ \color{blue}{40} & \color{red}{44} & 48 & 52 & 56\\ \color{blue}{60} & 64 & 68 & 72 & 76\\ \color{blue}{80} & 84 & \color{red}{88} & 92 & 96 \end{array}

Of the $25$ such numbers, three of them have a repeated digit ($\color{red}{00}, \color{red}{44}, \color{red}{88}$). Of the remaining $22$ choices, exactly six include the digit $0$ ($\color{blue}{04}, \color{blue}{08}, \color{blue}{20}, \color{blue}{40}, \color{blue}{60}, \color{blue}{80}$).

Since the leading digit of a three-digit positive integer cannot be $0$, in the absence of the restriction that the digits cannot be repeated, we would have nine choices for the leading digit. Given that restriction, we have $9 - 1 = 8$ choices for the leading digit when $0$ is one of the final two digits and $9 - 2 = 7$ choices for the leading digit when $0$ is not one of the final two digits. Since there are six admissible choices for the final two digits that include the digit $0$ and $22 - 6 = 16$ admissible choices for the final two digits that do not include the digit $0$, the number of three-digit numbers that are divisible by $4$ in which no digit is repeated is $$8 \cdot 6 + 7 \cdot 16 = 48 + 112 = 160$$

HINT: There are $\lfloor2.5-\epsilon\rfloor=2$ single digit multiples of four. (excluding $0$)

There are $\lfloor25-\epsilon\rfloor-2=22$ two digit multiples of four.

There are $\lfloor 250-\epsilon\rfloor-22-2=225$ three digit multiples of four.

You now have to subtract any cases where there are repeated digits.

• For reference: $\lfloor x\rfloor$ means the largest integer smaller than $x$, and $\epsilon$ is a very small positive constant. – Rhys Hughes Jun 23 '18 at 16:42
• What should be value of $\epsilon$ ? – Entrepreneur Jun 23 '18 at 16:44
• Don't worry about it. The idea is that $25-\epsilon=24.99999....$, thus $\lfloor25-\epsilon\rfloor=24$ – Rhys Hughes Jun 23 '18 at 16:46
• @N.F.Taussig Did you even read my answer? Look particularly at the last line, and the first word: "HINT" – Rhys Hughes Jun 24 '18 at 12:21