[Math] How many ways a 9 digit number can be formed using the digits 1 t0 9 without repetition such that it is divisble by $11$.

combinationscombinatorics

How many ways a 9 digit number can be formed using the digits 1 t0 9 without repetition such that it is divisible by $11$.

My attempt-
A number is divisible by 11 if the alternating sum of its digit is divisible by 11?

The other thing to notice is as it is a 9 digit number formed by digits 1 to 9, exactly once each digit from 1 to 9 will appear in the number.

Basically, the question boils down to how many ways we can arrange 123456789 so that the alternating sum of the digit is divisible by 11.

I am not able to proceed further. Any help would be appreciated.

Best Answer

Let's denote such a number by $\overline{a_9 a_8\cdots a_1}$ you get $$\sum_{i=1}^9 a_i = \sum_{i=1}^9 i = 45.$$ Furthermore we can indeed use the alternating sum to check divisibility by $11$. This can be expressed as $$(a_1+a_3+a_5+a_7+a_9) - (a_2+a_4+a_6+a_8) \equiv 0 \pmod{11}.$$ Since we already know the total sum of the digits we can simplify this somewhat to $$(45 -(a_2+a_4+a_6+a_8)) - (a_2+a_4+a_6+a_8) \equiv 0 \pmod{11},$$ which again simplifies to $$ a_2+a_4+a_6+a_8 \equiv 6 \pmod{11}.$$ Now we want to find the amount of distinct solutions this equation has, where we choose $a_2,a_4,a_6,a_8$ distinct and decreasing from $\{1,\dots 9\}$. I don't know a more clever trick than simply checking, which is not that difficult in this case.

  • Clearly $a_2+a_4+a_6+a_8 = 6$ has no solutions.

  • The equation $a_2+a_4+a_6+a_8 = 17$ has nine solutions and this is the most work.

  • The equation $a_2+a_4+a_6+a_8 = 28$ only has two solutions, namely $\left\{\{9, 8, 7, 4\}, \{9, 8, 6, 5\}\right\}.$
  • The equation $a_2+a_4+a_6+a_8 = 6+11k$ for $k\geq 3$ has no solutions since the maximum $9+8+7+6=30$ is already too small.

We get a total of $11$ choices of digits. For all these choices we can arrange $a_2,a_4,a_6,a_8$ in $4!$ ways and $a_1,a_3,a_5,a_7,a_9$ in $5!$. The total number of solutions is $$ 11\cdot 4! \cdot 5! = 31680. $$