Count binary numbers (5 in decimal) with no consecutive 1s. Track the previous digit. N = 101 in binary. Position : try (loose) or 1 (tight).
If , prevDigit = 1. Position : if prev = 1 and tight, can only try (since 1 would make consecutive 1s). If loose, try both but skip 1 if prev = 1. Position : continue. Valid numbers: , , , 100, 101. That's 5 numbers. The DP counts all valid paths.