I would like to find the number of possible ways of getting 1,2,3,4 distinct numbers in a sequence of 4 numbers chosen from 1-4. There are 4x4x4x4 = 256 possible permutations. First case: there are 4 ways of getting all 4 numbers the same:

1,1,1,1

2,2,2,2

3,3,3,3

4,4,4,4

For the second case, namely that there are only 2 numbers out of the set in the sequence (e.g, 1,2,2,1 or 3,4,3,4. I reasoned as follows: There are 4C2 = 6 ways of getting two numbers from a set of 4, and for each of these ways there are 2x2x2x2 = 16 ways of permuting the two numbers, but this includes the two cases where all the numbers are one or the other, so these have to be subtracted, which gives 6 x (16 - 2) = 84 possible ways. I'm pretty sure this is correct.

The case of all the numbers being different is quite easy to find: There are 4x3x2x1 = 24 ways.

Now since there is only one possibility left - that of 3 distinct numbers in the sequence of 4, there must be 256 - 84 - 24 -4 = 144 of these, assuming the above is correct.

However, I'm getting in a muddle trying to calculate the case of 3 distinct numbers from first principles. This is as far as I've got but it's not correct: There are 4P3 = 24 ways of choosing 3 numbers from 4, where order counts, and for each of these 24 ways there are 3 ways of picking another number to make up the set to four (because the 4th number must be one from the existing set of 3), which gives 24x3 = 72, but this is only half of the number obtained above.

Where am I going wrong or what have I missed out?

Many thanks in advance for any help!