How many seven-digit numbers have seven distinct nonzero digits that appear in increasing order from left to right?

If we were not restricted by the increasing order of digits, the solution would be $\binom{9}{7}\cdot7!=36\cdot7!=181\, 440$

However, the requirement of increasing order of digits truly throws a wrench into my plans.

I have noticed that the first digit must be less than or equal to $3$, so there are $3$ possible numbers for the first digit.

Then, we can perform casework to determine the number of possible numbers for the second digit.

  1. If the first digit is $3$, then the second digit must be $4$ (1 option).
  2. If the first digit is $2$, then the second digit can either be $3$ or $4$ (2 options).
  3. If the first digit is $1$, then the second can either be $2$, $3$, or $4$ (3 options).

So, there are $6$ possible second digits.

However, continuing down this path is highly tedious and prone to error. Is there a better way of solving this problem?

  • 3
    $\begingroup$ Hint: your 7-digit number is determined unambiguously by choosing 7 digits from the available 9. $\endgroup$
    – TonyK
    Commented Apr 24 at 22:22
  • $\begingroup$ This problem is more commonly phrased something like this, and indeed the usual analysis is like what TonyK says. $\endgroup$ Commented Apr 24 at 23:29
  • $\begingroup$ David do you realize all you are saying is "from a nine character string, choose two characters". $\endgroup$
    – Fattie
    Commented Apr 25 at 11:57
  • 3
    $\begingroup$ @Fattie They're both giving the same (correct) number, just expressed in two different ways. 9C7 = 9C2, because choosing seven out of nine digits to keep is equivalent to choosing two out of nine to discard. $\endgroup$
    – G_B
    Commented Apr 25 at 12:48
  • $\begingroup$ @GBsupportsthemodstrike so sorry, had a brain fart. Thanks for the quick embarrassment save! $\endgroup$
    – Fattie
    Commented Apr 25 at 14:29

2 Answers 2


For any seven distinct numbers you chose out of the possible nine, there is only one way to arrange them in an increasing order. So, the answer is just $\binom97$ without the $7!$.

Hope this helps. :)


Any number that satisfies your criteria can be thought of as a string. Example: "1 3 4 5 7 8 9". From this let us include the numbers we skipped in parenthesis: "1 (2) 3 4 5 (6) 7 8 9". We can do this for any number that satisfies your criteria. This alone is not particularly helpful with your question but let us think of it in the reverse order. Let's start with a string of the nine digits: "1 2 3 4 5 6 7 8 9". From here we need to make a seven digit number (or string, however you want to think about it). To do this we have to choose 2 numbers to omit. The resulting string satisfies your criteria and from the first part it follows that this will cover all possible numbers that meet the criteria. This gives us the beautifully simple answer: $(^9_2)$.


You must log in to answer this question.

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