How many six-digit numbers can be formed using the digits $0$ to $9$, where exactly one digit is repeated only once?

For example, some of those numbers can be:

In these $4$ numbers, I have only given the possible numbers that have the repeated digit in the last place. But the repeated digit can be in any place like:


So what is the quantity of all possible numbers?

For me:

We know that the 1st digit can't be $0$, so $9$ possibilities for the first digit. We have $5$ remaining places, where one place belongs to the repeated digit and the other $4$ places belong to $4$ other digits. We also know that the repeated digit can be any of the $5$ other digits within the number, and the repeated digit can be in any other place, so $5$ places for the repeated digit to go. (Except if it's a $0$, then it only has $4$ places.)

I'm stumped.

  • 1
    $\begingroup$ Divide into cases according to whether the repeated digits is $0$ or not. You may need to separately consider the case in which $0$ isn't one of the five digits at all (in any case, that's an easy scenario to count). $\endgroup$
    – lulu
    Jun 4, 2023 at 17:19
  • $\begingroup$ I believe you have a typo in "..a number with 6 different digits, where one of the 5 digits is repeated only once..." Pl. edit to avoid confusion. $\endgroup$ Jun 4, 2023 at 19:17
  • $\begingroup$ Welcome to MathSE. Please write a title that is specific to the problem. This MathJax tutorial explains how to typeset mathematics on this site. $\endgroup$ Jun 5, 2023 at 11:22

3 Answers 3


Using recommendation of @lulu, lets separate our problem according to existence of zero such that

  • Zero repeats two times:$$\binom{5}{2}.$$

where $\binom{5}{2}$ means selecting positions for zeros except for the leading digit

  • Zero repeats only once:$$\binom{5}{1}\binom{9}{1}\binom{5}{2}.8.7.6=151200$$

where $\binom{5}{1}$ means selecting positions for zero except for the leading digit. $\binom{9}{1}$ means selecting repeating digit and $\binom{5}{2}$ means selecting position for repeating digits

  • No Zero: $$\binom{6}{2}\binom{9}{1}$$

$\binom{6}{2}$ means selecting position for repeating digits and $\binom{9}{1}$ means selecting repeating digit



Hint Temporarily disregard the prohibition on leading $0$s. Notice that for any such number, we can increase each of the digits (modulo $10$) to produce another such number, and doing this $10$ times (and no fewer) returns us to our original number and hence partitions the set of all such numbers into groups of $10$. For example, $001234$ is a member of the block $$\{001234, 112345, \ldots, 889012, 990123\}$$ Evidently exactly one number in each block---hence exactly $\frac{1}{10}$ of all of the numbers---begins with a $0$.

So, we might as well determine the number of possibilities disregarding the complicating restriction on leading $0$s, after which the desired count is $\frac{9}{10}$ that figure.

Disregarding the condition on leading $0$s, there are ${6 \choose 2} = 15$ unordered pairs of positions for the repeated digit, then $10$ choices for the repeated digit, $9$ choices for the first unrepeated digit, ..., and $6$ choices for the last digit, that is, ${}_{10} \mathrm{P}_5 = \frac{10!}{(10 - 5)!}$ choices for the $5$ digits, for a total of ${6 \choose 2} \cdot{}_{10} \mathrm{P}_5 = 453\,600$ numbers. Applying the reasoning in the hint gives a final count of $$\frac{9}{10}{6 \choose 2} \cdot{}_{10} \mathrm{P}_5 = \frac{9}{10} \cdot 453\,600 = 408\,240 .$$


This is just a simpler exposition of Travis Willse answer which I am upvoting.

Any from the $10$ digits chosen, whether as a single or a double, has an equal probability of being the leading digit. Thus required answer is simply

$\small\text{P(non-0 leading digit)(choose double)(place double)(choose, permute remaining)}$

$$= \frac9{10}\cdot\binom{10}5\binom62\binom94*4! = 408 240$$

  • $\begingroup$ Sorry I came late to this question, engrossed in French Open ! Let it signal the beginning of a new era ! $\endgroup$ Jun 6, 2023 at 9:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .