The number of four-digit numbers that have distinct digits and are divisible by $99$

288 Views Asked by At

We try to find the number of four-digit numbers that have distinct digits and are divisible by $99$.


Let a number be $N = abcd$, then we have $9| N$ and $11|N$.

Thus $9| a+b+c+d$ and $a+c \equiv b+d \mod 11$.

I listed all the four-digit numbers that are divisible by $99$:

enter image description here

From here we can find the numbers with distinct digits. But this method is not elegant.

Is there an elegant method of doing it?


Update: $9| a+b+c+d$ and $a+c \equiv b+d \mod 11$ implies that $9 | a+c$.

Thus $a+c$ is either $9$ or $18$. We can't have $18$ since $a \neq c$.

Hence we have $(a,c) = (1,8),(2,7),(3,6),(4,5),(5,4),(6,3),(7,2),(8,1)$.

2

There are 2 best solutions below

0
On BEST ANSWER

Note that:

For a number to be divisible by $99$, the sum of doublets should be divisible by $99$.

Proof:

$abcdef=ab(10^4)+cd(10^2)+ef$
and $10^{2n} \mod 99 =1$
So, $abcdef \mod 99 = ab + cd + ef$
So, $ab+cd+ef$ should be divisible by $99$.

Now let's solve your problem:

Now for a $4$-digit number ($abcd$) to be divisible by $99$ we know that:
$ab+cd=99k$ where $k\in\Bbb Z$
Now we can easily see that $k$ must be $1$ as $k=0$ would mean $0000$, invalid and $k=2$ means $9999$, again invalid.

So, we can write $ab+cd=99k$ as $10(a+c) + b+ d = 99$
This means that $a+c=9$ and also, $b+d=9$.

Now moving on to cases:

Case $1$: Excluding $0$ (which also means excluding $9$):

We have now $8$ numbers left: $1,2,3,4,5,6,7,8$
Now $a$ can assume any of the $8$ values in $\binom 81$ ways corresponding to which $c$ will automatically assume it's complement.
Since we need all $4$ digits to be distinct so $b$ can now assume any value out of the remaining $6$ digits in $\binom 61$ ways and $d$ will assume it's complement.
So, in total, we get, $\binom 81 \binom 61 = 48$ ways for forming a $4$ digit number in required format.

Case $2$: Including $0$ (and thus $9$):

Now, out of $a$ and $c$, only $c$ can assume $0$ and $a$, $9$. Then $b$ can take any value out of the remaining $8$ digits in $\binom 81$ ways and $d$ will assume it's complement.
Now, out of $b$ and $d$ anyone can assume $0$, in $\binom 21$ ways and then $a$ can take any value from the remaining digits in $\binom 81$ ways, correspondingly $c$ will assume the complement.
So, in total, we get, $\binom 81 + \binom 21\binom 81 = 24$ ways of forming a $4$ digit number in the required format.

Total: (Case $1+$ Case $2$):

Thus, we get $48+24=\bf 72$ as the number of four-digit numbers that have distinct digits and are divisible by $99$.


Checked my result from your image by manual counting too ;) .

0
On

Not a 'real' answer, but it was too big for a comment. I think that you're looking for a solution without using a calculator or PC but maybe this gives some insight. I did a quick search using Mathematica.

I wrote and ran some Mathematica-code:

In[1]:=Clear["Global`*"];
ParallelTable[
  If[DuplicateFreeQ[IntegerDigits[n]] && IntegerQ[n/99], n, 
   Nothing], {n, 1000, 9999}] //. {} -> Nothing

Running the code gives:

Out[1]={1089, 1287, 1386, 1485, 1584, 1683, 1782, 1980, 2079, 2178, 2376, 
2475, 2574, 2673, 2871, 2970, 3069, 3168, 3267, 3465, 3564, 3762, 
3861, 3960, 4059, 4158, 4257, 4356, 4653, 4752, 4851, 4950, 5049, 
5148, 5247, 5346, 5643, 5742, 5841, 5940, 6039, 6138, 6237, 6435, 
6534, 6732, 6831, 6930, 7029, 7128, 7326, 7425, 7524, 7623, 7821, 
7920, 8019, 8217, 8316, 8415, 8514, 8613, 8712, 8910, 9108, 9207, 
9306, 9405, 9504, 9603, 9702, 9801}

Finding the number of solutions we can find:

In[2]:=Length[%1]

Out[2]=72

So, we can see that there are $72$ solutions.


Extending this to all natural numbers up to $10^9$:

In[3]:=Clear["Global`*"];
ParallelTable[
   If[DuplicateFreeQ[IntegerDigits[n]] && IntegerQ[n/99], n, 
    Nothing], {n, 0, 10^9}] //. {} -> Nothing // Length

Out[3]=89589

We can see that we have $89589$ solutions.