3

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?

sai-kartik
  • 2,100
  • Use this duplicate for an easy proof. Note that $24=4\cdot 6$. – Dietrich Burde May 25 '20 at 19:16
  • @DietrichBurde , thanks for the link but I am totally unfamiliar with the stuff used to answer the question. – sai-kartik May 25 '20 at 19:19
  • 3
    Since $7$ divides $1001$, another rule for divisibility by $7$ Involves subtract alternating $3$ digits; for example, $15001$ is divisible by $7$ because $15-1 $ is – J. W. Tanner May 25 '20 at 19:21
  • 1
    "but I am totally unfamiliar with the stuff used" That seems like a good place to start then. Prove or learn the proof that $x^{p-1}\equiv 1\pmod{p}$ for every prime $p$ and $x$ coprime to $p$. Then, use the result. – JMoravitz May 25 '20 at 19:21
  • 1
    "By which number"? Yes, it's divisible by $7$, but also by $3$, $9$, $11$, $13$, and many others. – Robert Israel May 25 '20 at 19:25
  • @RobertIsrael but the options were stated: 24, 12 , 7 and 31 so I bothered to ask only for 7 – sai-kartik May 25 '20 at 19:27
  • Also I appreciate everyone helping me here and sorry for not mentioning this sooner, but I'm still a student in 12th grade and I haven't learnt any of this stuff. However, I now know where to begin – sai-kartik May 25 '20 at 19:28

4 Answers4

2

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

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88
2

I think the text is a assuming a different divisible by $7$ rule. (The rule that J.W. Tanner pointed out in the comments.)

If you have a number that is $3k$ digits long $N= a_kb_kc_ka_{k-1}b_{k-1}c_{k_1}.....a_2b_2c_2a_1b_1c_1$ (you can add zeros to make it $3k$ digits long) you do

$M = a_kb_kc_k - a_{k-1}b_{k_1}c_{k_1} + ...... $ and seeing if $7$ divides $M$.

For example:

To find out if $42405231722$ is divisible by $7$ we take $-42+405 - 231+722 = 363 + 491=854$ and $854$ divided by $7$ is $122$ with no remainder so it is divisible by $7$.

So for $N= 111,111,111,111,111,111,111,111$ we take $111-111 + 111-111+111-111 + 111 -111 = 0$ so $N$ is divisible by $7$.

Why does the rule work?

Well $1001 = 7*143$ so $abcdef = abc*1000 + def = abc*1001 + def-abc = 7(abc*143) + (def-abc)$ so $abcdef$ will have the same remainder when divided by $7$ and $def-abc$.

So $-42+405 - 231+722$ has the same remainder as $42405 + 231722$ what has the same remainder as $-42405*1000 + 231722$ which has the same remainder as $42405*10^6 + 231722=42405231722$.

.....

All said and done this is not a good way to do it.

Better to note that $10^{ab} - 1 = (10^a-1)(10^{ab-b} + 10^{ab-2b} + .... + 10^b + 1)$ so $10^a -1|10^{ab}-1$ and then if $a$ is a prime other than $2$ and $5$ then $a|10^a-1$ and $a|10^{ab}-1$.

So $7|10^6-1 = 999,999$ and so $7|10^{24}-1 = (10^6-)(10^{18} + 10^{12} + 10^6 + 1)$.

fleablood
  • 130,341
1

Observe that $$a_n=\dfrac{10^n-1}{10-1},n\ge1$$

Now as $(10,7)=1$ and $\phi(7)=6$

$7$ will definitely divide $10^n-1$ if $6$ divides $n$

Again as $(10-1,7)=1,7$ will divide $a_n$ if $6$ divides $n$

1

Even if you're completely unfamiliar with the totient function, just basic arithmetic already fully suffices -

We start with a high speed chunking operation :

999,999,999,999,999,999,999,999

Divisibility by 7 can be chunked in multiples of 6-digits, so let's do 12+12 first (and keep chunking at the same width N as long as the chunked sum is still more than N digits) :

     999,999,999,999             999,999,999,998
   + 999,999,999,999    ——>    +               1
   -----------------           -----------------
   1,999,999,999,998             999,999,999,999

Then let's go to the 6-digits width level :

             999,999                     999,998
   +         999,999    ——>    +               1
   -----------------           -----------------
           1,999,998                     999,999

And there's the quick realization that 6 repeating digits (of ANY digit) is automatically divisible by 7.


    jot 9 111111 - 111111 | mawk '($++NF = $1 % 7)^_'
    111111 0
    222222 0
    333333 0
    444444 0
    555555 0
    666666 0
    777777 0
    888888 0
    999999 0

Which you can verify with any one of these chains :

999,999 --> 19,999 --> 5,999 --> 399 --> 49 --> 0
                       or    399 :=     - 1  +  20^2 
                                 := (20 - 1) * (20 + 1)
                                 :=      19  *  21

999,999 --> (99)(99)(99)
        -->   1 0 1 0 1 --> 10^4 + 10^2 + 1 
                        -->  3^4 +  3^2 + 1
                        -->  9^2 +    9 + 1  
                        -->  2^2 +    2 + 1
                        -->    4 +    2 + 1 --> 7 --> 0
999,999 --> 222,222 --> 5,222
                    --> 5,222 -  7^4 * 2 - 7^3 -->  77 --> 0
                     or
                    --> 5,222 - 70^2     - 7^3 --> -21 --> 0

But if you REALLY wanna do it the totient way, then

jot 6 0 | mawk '($++NF = 10^$1 % 7)^_'
 0    1           1
 1    3          10
 2    2         100
 3    6       1,000
 4    4      10,000
 5    5     100,000

Since every natural number (under the modulus) shows up exactly once in the 2nd column, then 6 repeating digits (or any digit) mod 7 is the same as

  DGT * ( 1 + 2 + 3 + 4 + 5 + 6 ) mod 7

= DGT * ( 6 * 7 / 2 ) mod 7 <-- by sum of integers formula

Since 7 is already a multiplier on the left hand side, then of course it's divisible by 7.


Side note : The divisors of the original number acts like digit concat

(with every partial product and grouped-multiplicands being a base-10 palindrome, doubling the # of 1s each round) :

                                  111    # 3 x 37
    x                           1,001    # 7 x 11 x 13
    ---------------------------------
                              111,111
    x                       1,000,001    # 101 x 9,901
    ---------------------------------
                      111,111,111,111
    x               1,000,000,000,001    # 73 x 137 x 99,990,001
    ---------------------------------
      111,111,111,111,111,111,111,111
    x                               9
    ---------------------------------
      999,999,999,999,999,999,999,999
    =================================