[Math] Test for divisibility by 2 for a number written in base 9

divisibilitynumber-systems

Given a number in base 9, so the number $n=a_t9^t+a_{t-1}p^{t-1}+\ldots+a_0$; then how to devise rule for divisibility by 2?

I hope there is no easy way without conversion of the number to base 10.

Have got help here, based on which I am stating the approach based on conversion to base 10 from base 9. In base $b+1$ where integer $b\ge1$ as:
$$b+1\equiv1\pmod b\implies(b+1)^r\equiv1^r\equiv1 \pmod b$$
$$\sum_{r=0}^t(b+1)^ra_r\equiv \sum_{r=0}^ta_r\pmod b$$
So, $\sum_{r=0}^t(10)^ra_r\equiv \sum_{r=0}^ta_r\pmod 9$

So, does it imply that because of the equivalence, the same rule exists for divisibility by 2, i.e. the sum of digits is divisible by 2?

If yes, then what about divisibility by 3 in base 9?

Best Answer

Your reasoning on the equivalence is correct; checking divisibility by 2 in base 9 is akin to checking for divisibility by 9 in base 10. Expanded: $$n=a_t9^t+ a_{t-1}9^{t-1}+\dots+a_0\equiv a_t1^t+ a_{t-1}1^{t-1}+\dots+a_0\equiv a_t+a_{t-1}+\dots+a_0\bmod2$$ so an integer in base 9 is divisible by 2 iff its sum of digits is, and thus iff an even number of its digits are odd (1, 3, 5, 7).

As for checking divisibility by 3 in base 9, that's trivial. Since 3 divides 9, an integer in base 9 is divisible by 3 iff its last digit is 0, 3 or 6.