I was reading about how to know if a number is divisible by 3 given binary representation of the number.
After googling a bit I read a statement and I am puzzled how is this correct.
we have to just count the number of 1's (set bits) at even position and number of 1's (set bits) at the odd positions. If the difference is divisible by 3, the number is divisible by 3.
Can anyone please help in understanding the logic behind this.