Number of $11-$digit length number with all $10$ digits and no consecutive same digits
All your desired strings have one digit that occurs twice, while the others occur once. So here is a method to get all those strings:
- Place all ten digits into a ten-digit string. This can be done in $10!$ ways.
- Choose one digit to be the repeated digit. This can be done in $10$ ways.
- Choose a position in the ten-digit string from step $1$ to insert that repeated digit. The ten-digit string has $11$ places to insert, but $2$ of them are next to the same digit, so there are $9$ allowable places to insert the digit.
Inserting the digit into the position in the ten-digit string gives us an allowable eleven-digit string. However, we have double-counted every eleven-digit string, since we could have inserted the other occurrence of the repeated digit. So we must divide our count by two.
Our final count is then
$$\frac{10!\cdot 10\cdot 9}2=163,296,000$$
In your check of $4$-digit strings with $3$ digits, that would be
$$\frac{3!\cdot 3\cdot 2}2=18$$
A quick check of that in MS Excel confirms that is correct. (For the $4$-digit strings: even Excel doesn't easily handle over one hundred million lines!)
You have to repeat exactly one digit.
So, first choose the digit that you repeat (how many possibilities?), then choose where those two digits go in the number (how many possibilities?), and finally choose the order for the remaining $9$ digits (how many possibilities?)
(The answer is $163,296,000$.)