34. The digits of the number 123456789 can be rearranged to form a number that is divisible by 11. For example, 123475869, 459267831 and 987453126 . How many such numbers are there?
34. Ans: 31680 .
Let $X$ and $Y$ be the sum of the digits at even and odd positions respectively. Note that $1+2+3+\cdots+9=45$. We have $X+Y=45$ and 11 divides $|X-Y|$. It's easy to see $X=17$ and $Y=28$; or $X=28$ and $Y=17$. Hence we split the digits into 2 sets whose sum is 17 and 28 respectively.
There are 9 ways for 4 digits to sum to 17 : $\{9,5,2,1\},\{9,4,3,1\},\{8,6,2,1\},\{8,5,3,1\}$, $\{8,4,3,2\},\{7,6,3,1\},\{7,5,4,1\},\{7,5,3,2\},\{6,5,4,2\}$. There are 2 ways for 4 digits to sum to 28 : $\{9,8,7,4\},\{9,8,6,5\}$. Thus the total number of ways is $11 \times 4!\times 5!=31680$.