# 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.

combinatorics permutations

-
Perhaps the following rule helps: A number is divisible by 11 if the sum the digits with alternating $\pm$ signs is zero or divisible by 11 –  Peter Grill Jun 7 '12 at 3:01
Rereading your questions it seems that perhaps it is not complete:You talk about 5 digit numbers, and 7 digit numbers. –  Peter Grill Jun 7 '12 at 3:03

A number is divisible by $11$ if the sum of the digits in the tens and thousands place minus the sum of the digits in the ones, hundreds, and ten thousands place is divisible by 11.

So take a number:

$a b c d e$

$(b+d)-(a+c+e)$ is divisible by $11$ (it may be $0$).

$a+b+c+d+e=30$.

$a,b,c,d,e$ are all integers that may be $0$ through $9$. $a\not=0$.

Combining the two equations above, $2(b+d)-30$ is divisible by $11$, but is also even (since $b$ and $d$ are integers), so it may be $0$, $22$, or $-22$.

If it is $22$, then $(b+d)=26$, which is a contradiction.

If it is $0$, then $(b+d)=(a+c+e)=15$ (condition 1)

If it is $-22$, then $(b+d)=4$ and $(a+c+e)=26$ (condition 2)

Take all such $a,b,c,d,e$ that satisfy the above statements.

If condition 1 holds, then there are $4$ different ways to choose $b$ and $d$ and $4+5+6+7+8+9+9+8+7+6=69$ ways to choose $a,c,e$ that satisfy $a+c+e=15$. Thus, for condition 1, there are $276$ distinct numbers that satisfy condition 1.

If condition 2 holds, then there are $4$ different ways to choose $b$ and $d$ and $3$ ways to choose $a,c,e$. So there are $12$ distinct numbers that satisfy condition 2.

Thus, there are $288$ distinct 5-digit numbers that satisfy the desired condition.

-

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?

-