xor-shift-produces-all-ones

Status: IN

For any integer with alternating bits, `n ^ (n >> 1)` produces a value of the form `2^k - 1` (all ones), which is the invariant the solution checks.

Source: entries/2026/06/06/binary-number-with-alternating-bits-solution.md

JSON