1 problem found
How many integers between \(10\,000\) and \(100\,000\) (inclusive) contain exactly two different digits? (\(23\,332\) contains exactly two different digits but neither of \(33\,333\) and \(12\,331\) does.)
Solution: First consider \(5\) digit numbers containing at most \(2\) non-zero digits. Then there are \(\binom{9}{2}\) ways to choose the two digits, and \(2^{5}-2\) different ways to arrange them, removing the ones which are all the same. Considering all the pairs including zero, there are \(9\) ways to choose the non-zero (first) digit. There are \(2^4-1\) remaining digits where not all the numbers are the same. Finally we must not forget \(100\,000\). Therefore there are \(\binom{9}{2}(2^5-2) +9\cdot(2^4-1) + 1 = 1216\)