1) Let $a$ be the number of 5-digit numbers divisible by 9 that don't contain the digit 9.

2) Let $b$ be the number of 5-digit numbers divisible by 5 that don't contain the digit 5.

3) Let $c$ be the number of 5-digit numbers divisible by 4 that don't contain the digit 4.

4) Let $d$ be the number of 5-digit numbers divisible by 3 that don't contain the digit 3.

Enter $a + b + c + d$ .

**
Detail.-
**
A 5-digit number is a natural number belonging to
$[10000,99999]$

The answer is 40824.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

To be divisible by $9$ , the sum of the digits of the number must be divisible by $9$ . Ignoring the digit $9$ , there is exactly one digit of each remainder modulo $9$ . Thus, whatever the first four digits of the number are, there is exactly one possible final digit that will leave the final number $9$ -free yet divisible by $9$ . Thus there are as many five-digit numbers that are $9$ -free, yet divisible by $9$ as there are ways of choosing $9$ -free four-digits numbers. Thus $a = 8\times9\times9\times9 = 5832$ .

To be divisible by $5$ , the final digit of the number must be $0$ or $5$ . Thus, whatever the first four digits of the number are (provided that they do not contain $5$ ), there is exactly one possible final digit ( $0$ ) that will leave the number $5$ -free yet divisible by $5$ . Thus $b = 8\times9\times9\times9 = 5832$ .

To be divisible by $4$ , the final two digits of the number must form a number divisible by $4$ . Since we cannot use $4$ , there are exactly two final digits that can be chosen, whatever the penultimate digit is and provided that the first four digits are $4$ -free, to make the final number $4$ -free yet divisible by $4$ (if the penultimate digit is even, the final digit can be $0$ or $8$ , while the final digit can be either $2$ or $6$ when the penultimate digit is odd). Thus $c = 8 \times9\times9\times9\times2 = 11664$ .

To be divisible by $3$ , the sum of the digits of the number must be divisible by $3$ . Ignoring the digit $3$ , there is exactly three available digits of each remainder modulo $93$ (we have $0,6,9$ giving remainder $0$ , then $1,4,7$ giving remainder $1$ , and finally $2,5,8$ giving remainder $2$ ). Thus, whatever the first four digits of the number are, provided they are $3$ -free, there is exactly three possible final digits that will leave the final number $3$ -free, yet divisible by $3$ . Thus $a = 8\times9\times9\times9\times3 = 17496$ .

This makes $a+b+c+d = 8\times9\times9\times9(1 + 1 + 2 +3) = \boxed{40824}$ .