How many combinations for a 5 digit code using 3 numbers. Can anyone please help here?
I have inherited a strange looking safe with only numbers 1 2 and 3.
The code to open it is 5 digits and the code uses all three numbers at least once.
Is there some formula I can apply to list all the combinations?
Thanks

Much simpler is to just [choose numbers] $\times$ [permute them]
3-1-1 of a kind, e.g 22231: $\binom{3}{1,2}\times\frac{5!}{3!} = 60$
2-2-1 of a kind, e.g. 22113: $\binom{3}{2,1}\times\frac{5!}{2!2!} = 90$
yielding the answer of 150
