If $b_nb_{n-1} \cdots b_0$ is the binary representation of natural $x$, and if $(b_0-b_1+b_2-b_3+\cdots+(-1)^nb_n)=0\pmod3$, then $x=0\pmod3$

40 Views Asked by At

Let $b_nb_{n-1} \cdots b_0$ be the binary representation of a number $x \in \mathbb{N}$.

Show that if $(b_0 - b_1 + b_2 - b_3+ \cdots + (-1)^n b_n) = 0 \pmod3 $, then $x = 0 \pmod 3$.

I've tried some examples like $84_{(10)} = 1010100_{(2)}$ which has the sum $0 - 0 + 1 - 0 + 1 - 0 + 1 = 3 = 0 \pmod3$ and $84 = 0 \pmod3$, and I've noticed that the hypothesis remains true, but I can't figure out a mathematical proof for this.

3

There are 3 best solutions below

0
On BEST ANSWER

As for how to come up with a solution, sometimes testing with purposeful simple examples could give insights to these problems.

Observe:
$1_{(10)} = 2^0_{(10)} = 1_{(2)}$. The sum is $1 \pmod{3}$.
$2_{(10)} = 2^1_{(10)} = 10_{(2)}$. The sum is $-1 \pmod{3}$.
$4_{(10)} = 2^2_{(10)} = 100_{(2)}$. The sum is $1 \pmod{3}$.
$8_{(10)} = 2^3_{(10)} = 1000_{(2)}$. The sum is $-1 \pmod{3}$.

Observe that as the exponent of $2_{(10)}$ increases, the sum$\pmod{3}$ alternates between $1$ and $-1$.
Would it remind you of some patterns?

Also, notice that base $10$ is not mentioned in the question. This may mean it is irrelevant, and we probably have better chances if we construct our examples in base $2$.

2
On

$$x = \sum_{i=0}^n b_i2^i$$

Notice that we have $2 \equiv -1 \pmod{3}$, can you complete the proof?

0
On

It's binary so $x=\sum_{i=0}^{n}b_i 2^{i}$. Now we see $x \ (\mathrm{mod}\ 3) \equiv \sum_{i=0}^{n}b_i \cdot (-1)^i \equiv 0$ (from what was given).