This is from AMC 2015 . For each positive integer n, let S(n) be the number of sequences of length n consisting solely of the letters A and B, with no more than three As in a row and no more than three Bs in a row.
I want to find out a recurrence relation for S(n). I am not able to get it after many tries. I guess its not a simple one.
Any hints are welcome.