<s>[INST] Finding the numbers having a particular factor,an upper limit and a specific set of digits. Question : 
How many numbers less than $50000$ can be formed which are multiples $6$ using the digits $0,1,2,3,4,5$?
My attempt : 
First of all, for a number to be a multiple of $6$, it should be a multiple of $2$ as well as $3$. So, the number must be even as well as it's sum of digits should be a multiple of $3$. Next, the number should have only the digits $1,2,3,4$ in the first position as it has to be less that $50000$. But, I face a problem, If I put $2$ or $4$ in the first position, then I will have one less even digit for the last position and there would be cases where I only use the digits $0,1,2,4,5$ or $1,2,3,4,5$ so as to make the number divisible by $3$. So, is there an efficient way to cover all the cases and get the answer quickly?
All help will be appreciated.
 [/INST] We put it in three cases as the last digit must be either $0;2$ or $4.$ (I assume that you can use each digit only once).
First case: The number is in the form $\overline{abcd0}$, which means the numbers $a,b,c,d$ are $4$ of the remaining numbers available $(1;2;3;4;5)$.
There are $5$ ways of picking four numbers from this set, we add $a,b,c,d$ along with $e$ for each pick:
$1+2+3+4+0=10$, not divisible by $3$.
$1+2+3+5+0=11$, not divisible by $3$.
$1+2+4+5+0=12$, divisible by $3$.
$1+3+4+5+0=13$, not divisible by $3$.
$2+3+4+5+0=14$, not divisible by $3$.
We conclude that $(a,b,c,d)$ must be a permutation of $(1;2;4;5)$ that satisfy $a<5$.
For each sub-case $a=1;a=2;a=4$, note that $(b,c,d)$ is a permutation of $3$ remaining numbers in the set, so each sub-case will have $3!=6$ possible outcomes for $b,c,d$.
In total, this first case  (including $3$ sub-cases) should have $6 \times 3=18$ satisfied numbers.
Second case: The number is in the form $\overline{abcd2}$, which means the numbers $a,b,c,d$ are $4$ of the remaining numbers available $(0;1;3;4;5)$.
There are $5$ ways of picking four numbers from this set, we add $a,b,c,d$ along with $e$ for each pick:
$0+1+3+4+2=10$, not divisible by $3$.
$0+1+3+5+2=11$, not divisible by $3$.
$0+1+4+5+2=12$, divisible by $3$.
$0+3+4+5+2=14$, not divisible by $3$.
$1+3+4+5+2=15$, divisible by $3$.
We conclude that $(a,b,c,d)$ must be a permutation of $(0;1;4;5)$ or $(1;3;4;5)$ that satisfy $a<5$ and $a\ne 0$.


*

*Case 2.1: $(a,b,c,d)$ is a permutation of $(0;1;4;5)$ that satisfy $a<5$ and $a\ne 0$. There are two sub-cases for this one ($a=1;a=4$), plus each sub-case has $6$ possible outcomes for $b,c,d$, so there are $6 \times 2 =12$ satisfied numbers.

*Case 2.2: $(a,b,c,d)$ is a permutation of $(1;3;4;5)$ that satisfy $a<5$ and $a\ne 0$. There are three sub-cases for this one ($a=1;a=3;a=4$), plus each sub-case has $6$ possible outcomes for $b,c,d$, so there are $6 \times 3 =18$ satisfied numbers.
So the second case should have a total of $12+18=30$ satisfied numbers.
Third case: The number is in the form $\overline{abcd4}$, this is similar to the second case, you can do it by yourself, after finishing it you can check the answer below.

 There are $78$ five-digit numbers less than $50000$ divisible by $6$ and can be formed by using the digits $(0;1;2;3;4;5)$

I think you should do similarly for the case one, two, three, four digit numbers, so here are two extra hints to do them:

 The number of ways to choose $k$ objects from $n$ objects, which the order does not matter, is: $$\frac{n!}{k!(n-k)!}$$
 For this problem the order of choosing numbers is important, so the number of permutations of $n$ distinct objects is $n!$.

I don't think this is a quick way, but it will surely help you to get the correct answer.
</s>