How many numbers with 6 digits can be formed with the digits 1,2,3,4,5 such that the digit 2 appears every time at least three times? How many numbers with 6 digits can be formed with the digits $1,2,3,4,5$ such that the digit $2$ appears every time at least three times.
My try:
Total numbers: $5^6$
Numbers in which 2 doesn't appear: $4^6$
Numbers in which 2 appear once : $6\cdot4^5$
Numbers in which 2 appear twice : $13\cdot4^4$
So my result is: $5^6-4^6- 6 \cdot4^5-13\cdot4^4=2057 $ but the right answer is $1545$ How solve it ?

...or the other way around: $\binom{6}{3}4^3 + \binom{6}{4}4^2 + \binom{6}{5}6^1 +1$. Keep in mind $\binom{6}{4} = \binom{6}{2}$. It's a term longer, but gives you an opportunity to compute sm binomial coefficients.
