Convert to binary. Now each "digit" is or . At each position, you choose or (subject to tight bound). The constraint: no two consecutive s. You need to track the previous bit.
If the previous bit was , you can't place again. State: . The tells you whether placing at this position would create . Understanding the problem structure is half the battle.