Problem 3370 · Easy
Grow the all-ones candidate 1, 3, 7, 15, ... until it reaches n; each step appends one set bit.
Open the interactive visualisation