Why does this property hold true?
say the kth bit from right side is the first set bit in number 'x'. (x-1) will toggle every bit upto kth bit from right side.
I can verify this property by writing the bit sequence for the numbers but I don't understand as to why this property is true? Can anyone help me with a simple proof or intuition as to why this works?