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

Its easy see we can have repetition its just choosing 1 from 3 digits everytime now we want $5$ digits . Now for every digit we have single choices . So its $3.3.3.3.3=243$ Thats all. 
