Recurrance for how many ways to color this line?

48 Views Asked by At

If you have a line with n segments, how many ways can you color it with the colors Green, Blue and Red, if there are no adjacent blue segments?

My answer is $ 2a_{n-1} + a_{n-2} $

My reasoning:

Possibilities

______________G  (n-1)
______________R  (n-1)
______________B  (n-1-1 = n-2  (Don't count the BB ending)