Number of 5-digit positive integers divisible by 3 whose first digit is an even number? This exercise came up in my probability homework, but I do not know how to solve it with combinatorial methods. The only thing I could think of is seeing that the first 5-digit number with this property is 10,002 and the last one is 99,999. Thus, $10,002 + 3n = 99,999 \iff n = 29,999$, so there are $n + 1 = 30,000$ numbers with this property. How do I count the numbers with an even first digit only?
 A: There are four possibilities for the first digit $d$:


*

*$d = 2$: 3333 possibilities, ranging from 20001 to 29997

*$d = 4$: 3333 possibilities, ranging from 40002 to 49998

*$d = 6$: 3334 possibilities, ranging from 60000 to 69999

*$d = 8$: 3333 possibilities, ranging from 80001 to 89997
As such, the number of five-digit numbers which start with an even digit and are divisible by 3, equals:
$$3333 + 3333 + 3334 + 3333 = 13333$$
This result can be verified with the following Python script:
i = 0
for a in range(10000, 100000):
  if a // 10000 % 2 == a % 3 == 0:
    i += 1
print(i)

A: There are $3333$ numbers each between $0001$ and $9999$ having remainder $0$, $1$, or $2$ modulo $3$, and $0000$ has remainder $0$. On the other hand, $2$ and $8$ have remainder $2$, whereas $4$ has remainder $1$, and $6$ has remainder $0$. It follows that the number $N$ asked for is given by
$$N=(2+1)\cdot3333+1\cdot3334=13\,333\ .$$
A: As this is a homework in probability, I'd go another route. There is a total of 90000 5-digit numbers. Four out of possible nine first digits are even. Every third number is divisible by 3. So it's $90000\cdot \frac49 \cdot \frac13 \approx 13333$.
A: As you say, 1 out of 3 numbers have this property.
If it starts with a $2$, the first is $20001$ and the last one $29997$. This means $\lfloor\frac{29997-20001}{3}\rfloor=3332$ However, doing like this, we forget one number. So, in addition, yo have 3333 numbers (the same for all $n mod 3=2$).
If it starts with a $4$ is $40002$ and the last one $49998$. This means you have $\lfloor\frac{49998-40002}{3}\rfloor=3332$ numbers. However, doing like this, we forget one number. So, in addition, yo have 3333 numbers (the same way all $n mod 3=1$).
If it starts with a $6$, the first is $60000$ and the last one $69999$. This means you have $\lfloor\frac{69999-60000}{3}\rfloor=3333$ However, doing like this, we forget one number. So, in addition, yo have 3334 numbers (the same for all $n mod 3=0$).
Now, just add
