Divisibility of $a_{24}$ by 7. ($a_n=\underbrace{999\cdots9 }_{n \text{ times}})$

divisibilityelementary-number-theoryrepunit-numbers

Question: By which number is $a_{24}$ divisible by?
Where $a_n=\underbrace{999\cdots9 }_{n \text{ times}}$

The solution says the answer is $7$. Here's what is given:

$$a_{24}=\underbrace{999\cdots9 }_{24 \text{ times}}$$
$$=9(\underbrace{\underline{111} \ \ \underline{111}\ \ \underline{111} \ \cdots \ \ \underline{111})}_{8 \text{ similar sets}}$$
Now differences of each set is $0$. Hence $a_{24}$ is divisible by $7$.

Now what I don't understand is what are they implying when they say "difference of each set is $0$" . Also , why does this imply that the number is entirely divisible by $7$?

Also I know the divisibility rule of $7$ to be: Double the last digit, subtract the obtained number from whatever remains after removing the last digit and then check if the final number obtained is divisible by 7.

This process can go lengthy for this question here. Is there any way to solve it quicker?

Best Answer

To address what you don’t understand about the solution given, you should become aware that there is another rule for divisibility by $7$ besides the one you mentioned. This rule is to alternately add and subtract $3$-digit chunks of the number starting with the last $3$ digits and testing whether the result is divisible by $7$. For example, $7003010$ is divisible by $7$ because $10-3+7$ is. This rule works because $7$ divides $1001.$ (By the way, it works for $11$ and $13$ too.) Using this rule, it becomes obvious that any number written as a string of $n$ $1$s, where $n$ is a multiple of $6$, is divisible by $7$.

Related Question