(I posted already that for-loop question from our exam, sorry if this comes out as flooding)
So the question was short and clear, but I can't figure out the answer.
We have four colors (blue and three others) of poker chips in a stack of n chips. In how many ways can the stack be formed so that blue chips are not directly on top of each other?
What I understood by myself:
For example with three chips the options are
1) b o b (o = other, b = blue)
2) o b o
3) o o b
4) b o o
5) o o o
Which gives us 3+9+9+9+27=57 ways.
With two chips the options are
1) b o
2) o b
3) o o
Which gives us 3+3+9 = 15 ways.
But I can't figure out any kind of formula for this.
If someone posted already similar question, a link to that thread would be nice.