How many integers $n$ are there with the property that the product of the digits of $n$ is 0 , where $5000 \leq n \leq 6000$ ?
(A) 332
(B) 270
(C) 301
(D) 272
(E) 299
Solution 1

The product of the digits of $n$ is 0 if at least one of the digits of $n$ equals 0 .

Consider the integers from 5000 to 5999 , inclusive, which are each of the form $5 x y z$.

How many of these do not include a 0 ?

If $5 x y z$ does not include a 0 , there are 9 possibilities for each of $x, y$ and $z$ (namely 1 to 9 ), and so there are $9^{3}=729$ such integers.

Therefore, $1000-729=271$ of the integers from 5000 to 5999 actually do include a 0 .

We must also consider 6000 , which includes a 0 .

Therefore, there are $271+1=272$ integers $n$ with $5000 \leq n \leq 6000$ with the property that the product of the digits of $n$ is 0 .

## Solution 2

The product of the digits of $n$ is 0 if at least one of the digits of $n$ equals 0 .

We carefully count the number of integers with 0 in each position, being careful not to "double count" any integers.

The integer $n=6000$ includes a 0 , so contributes 1 integer to the total.

There are 100 integers of the form $50 x y$ (namely, 5000 to 5099).

There are 10 integers of the form $510 y$ (namely, 5100 to 5109). Similarly, there are 10 integers of each of the forms $520 y, 530 y$, and so on to $590 y$. This gives 9 sets of 10 integers, or 90 integers more.

There are 9 integers of the form $51 x 0$ where $x$ is not 0 (namely, 5110, 5120 and so on up to 5190). Similarly, there are 9 integers of each of the forms $52 x 0,53 x 0$, and so on. This gives 9 sets of 9 integers, or 81 integers more.

In total, there are thus $1+100+90+81=272$ such integers.