Scan the binary digits of n and strike out every block of consecutive zeros of odd length: the survivors are exactly the n with b(n) = 1. That one rule produces the Baum-Sweet sequence — 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, ... — one of the first "automatic" sequences ever studied, still famous for the almost-mysterious smoothness its generating function displays near the unit circle.
Baum-Sweet Numbers Generator evaluates b(n) by the run rule itself for any start index, prints each binary form together with its zero-run analysis, and keeps a live census of 1s across the block.