Let's say I have the letters A, B, C, D. I want to know the number of combinations in the space _, _, _, or 3, where repetitions are allowed. For this, I can apply the formula C=$n ^ x$. In the example would be C=$4 ^ 3$=64.
My question is: How do I calculate this, but if only one letter can be repeated? Let's just say "A" can be repeated.
For instance:
A, A, A
A, B, A
C, A, A
D, A, B (This one does not repeat any, but is part of the result)
...
...
Thanks!