The XOR sum of 4x, 4x + 1, 4x + 2 and 4x + 3 is 0 for any non-negative integer x

In this article, we would use to represent the bitwise XOR operation between two integers. We observe that: for any , , and therefore, for any .

We now illustrate the formal proof of the above observation.

We firstly write into a binary format, i.e.:

Let . Then:

Then the binary formats of are:

Since the most significant bits of all aforementioned numbers are the same, the XOR sum of this part should be 0. For the latter bits, i.e., the 2 least significant bits, it is easy to compute that:

Therefore, , and the proof is done.