Every power of maps to a single bit. is bit . is bit . In code, is just 1 << k (left shift by ).
This connection is everywhere. Checking if bit is set in a number : n & (1 << k). Setting bit : n | (1 << k). Clearing bit : n & ~(1 << k).
A number with all lower bits set is . In binary, . You get this with (1 << k) - 1, and it's useful as a bitmask.
Checking if is a power of : n & (n - 1) == 0. A power of has exactly one bit set. Subtracting flips that bit and sets all lower bits, so the AND gives zero.