Problem 3370 · Easy

Smallest Number With All Set Bits

Grow the all-ones candidate 1, 3, 7, 15, ... until it reaches n; each step appends one set bit.

Open the interactive visualisation