Skip to content / Đến nội dung
ThichHocToan.com

SMO 2009 Senior Round 1 Question 34

SMO · SMO 2009 Senior Round 1

Question 34

Using the digits $1,2,3,4,5,6,7,8$, we can form $8!=40320$ eight-digit numbers in which the eight digits are all distinct. For $1\le k\le40320$, let $a_k$ denote the $k$th number when these numbers are arranged in increasing order:
$$12345678,12345687,12345768,\ldots,87654321.$$
Thus $a_1=12345678$, $a_2=12345687$, $\ldots$, $a_{40320}=87654321$. Find $a_{2009}-a_{2008}$.