how many 5-digit numbers satisfy the following conditions How many five-digit numbers divisible by 11 have the sum of their digits equal to 30?
I am able to get the 5-digit numbers divisible by 11
and
I am also able to get the five-digit numbers whose sum of their digits equal to 30.
But i am not able to get how i can get the count of 5 digit numbers satisying both the condition.
Thanks in advance.
Thanks in advance.
combinatorics permutations

An integer written in ordinary base ten notation is divisible by $11$ if and only if the alternating sum of its digits is divisible by $11$. That is, if the digits of a five-digit number are $d_1,d_2,d_3,d_4,d_5$ from left to right, the number is a multiple of $11$ if and only if $d_1-d_2+d_3-d_4+d_5$ is a multiple of $11$. Let $x=d_1+d_3+d_5$ and $y=d_2+d_4$; you need to choose the digits so that $x+y=30$ and $x-y$ is a multiple of $11$. Since digits must be between $0$ and $9$ inclusive, the smallest possible value of $x-y$ is $-18$ (or $-17$ if you don’t allow leading zeroes), and the largest possible value is $27$. Thus, the only possible multiples of $11$ are $-11,0,11$, and $22$. We’ll consider each of them separately.
If $x-y=-11$, we must solve the system $$\begin{cases}x+y=30\\x-y=-11\;;\end{cases}$$ adding the equations yields $2x=19$, which is clearly impossible, since $x$ and $y$ must be integers. A similar problem arises if $x-y=11$, so we abandon that possibility as well.
If $x-y=22$, adding the equations yields $2x=52$, so $x=26$, and $y=4$. The only way to have three digits that sum to $26$ is to have two $9$’s and an $8$; two digits that sum to $4$ must be a $0$ and $4$, $1$ and $3$, or a pair of $2$’s. There are $3$ ways to arrange the first, third and fifth digits: $8\_9\_9$, $9\_8\_9$, and $9\_9\_8$. The other two digits can be chosen and arranged in $5$ ways: $\_0\_4\_$, $\_4\_0\_$, $\_1\_3\_$, $\_3\_1\_$, and $\_2\_2\_$. Thus, there are $3\cdot5=15$ numbers of the desired type in this case.
If $x-y=0$, we have $x=y=15$. To finish the problem, you need only count the number of ways to pick three digits adding up to $15$ for the first, third, and fifth slots, and two more adding up to $15$ for the remaining two slots. Clearly there are just $4$ ways to do the latter: $\_6\_9\_$, $\_9\_6\_$, $\_7\_8\_$, and $\_8\_7\_$. Can you finish it off from here?
