I am confused on part b). I am pretty sure part a) is correct. If someone could explain/show where I am going wrong, it would be much appreciated.
Part a) : Find a recurrence relation for the number of ways to arrange three types of flags on a flagpole n feet high: red flags (1 foot high), gold flags (1 foot high), and green flags (2 feet high).
My solution to this was $A_n = 2A_{n-1} + A_{n-2}$ with $A_0 = 1, A_1 = 2$
Part b) Repeat part (a) with the condition of no red above gold above green (in a row).
My Solution:
$A_0 = 1, A_1 = 2, A_2 = 5$
My thinking is it would be the same as part a), but when last flag in sequence is red, subtract 1 for the scenario when it matches the forbidden subsequence.
So, my solution would be $A_n = (A_{n-1} - 1) + A_{n-1} + A_{n-2}$ with $A_0 = 1, A_1 = 2$