How to prove if a binary number is divisible by 3?

4.8k Views Asked by At

I want to know how can I prove if a binary number is divisible by 3? I've found the answer for a decimal num but I need binary form. (using modular arithmetic a∣b)

1

There are 1 best solutions below

7
On BEST ANSWER

To prove that a certain number is divisible by $3$, the most convincing strategy is to show a number that when multiplied by $3$ yields the target number.

As for a digit-based test for divisibility by $3$:

Count the number of 1 bits in even posititions (that is, ones, fours, sixteens, and so forth). Subtract the number of 1 bits in odd positions (that is, twos, eights, thirty-twos, and so forth). The result of the subtraction is divisible by $3$ if and only if the original number was.