What I've tried so far is converting $12345654321$ into base $10$ (which is $384473664$) and using the long division algorithm to find the remainder, which I found to be $0$. Is there a more succinct and concise way to find the remainder which doesn't involve changing base? I know how to use modular arithmetic for increasing powers, but not sure how I would apply it in this scenario.
Finding remainder $x$ when $12345654321_7$ is divided by $8$, and $0\le x < 8$
-
0If you already converted to base 10 you just have to check remainder of 664 by 8. – 2017-01-18
3 Answers
This is the same as the test for divisibility by $11$ in base $10.$ Add the alternating sum of the digits (from right to left):
$$ 1-2+3-4+5-6+5-4+3-2+1 = 0$$
which is the remainder.
-
0I gave a generalized answer of the same a little back :) – 2017-01-18
In base $b,$ as $b\equiv-1\pmod{b+1},b^r\equiv(-1)^r$
$$\sum_{r=0}^na_rb^r\equiv\sum_{r=0}^n(-1)^ra_r\pmod{b+1}$$
$\sum_{r=0}^n(-1)^ra_r=a_0-a_1+a_2-a_3+\cdots$
where $a_r$ is the $r$th digit
$8$ is $11_7$, and we can recognize $12345654321_7$ as being in the general form of a square of a repunit:
$$ 111111_7 \cdot 111111_7 = 12345654321_7 $$ Also, clearly, we have $$ 111111_7 = 11_7 \cdot 10101_7 $$ so $$ 12345654321_7 = 11_7 \cdot ( 10101_7\cdot 111111_7 ) $$ Therefore the division comes out even: the remainder is zero.
If we don't already know the nice shape of squares of small repunits, there's always the general rule for the remainder of a base-$b$ number divided by $11_b$: Sum the digits in odd positions, subtract the sum of the digits in even positions, and divide the result by $11_b$ again. Here we get $$ (1+3+5+5+3+1) - (2+4+6+4+2) = 18_{\text{ten}} - 18_{\text{ten}} = 0 $$ so the remainder is, again, $0$.
If everything else fails, do long division directly in base seven:
1122332211
12345654321 / 11
-11
13
-11
24
-22
25
-22
36
-33
35
-33
24
-22
23
-22
12
-11
11
-11
0
(This computation is actually indistinguishable from dividing $12345654321_{\text{ten}}$ by $11_{\text{ten}}$, since there are no carries or borrows anywhere). Remainder is once again $0$.