Can someone help me with this problem?

Determine the number of positive integers less than 10,000 that can be formed from the digits 1, 2, 3, and 4 if repetitions are allowed.

Thank you!

2 answers

since there are 4 choices for each digit, and the numbers may be 1,2,3 or 4 digits long, you have

4^1 + 4^2 + 4^3 + 4^4 = (4^5-1)/(4-1) = 1023/3 = 341
oops. Since 0-length numbers are not allowed, we really have only 340 possibilities.