I tried to solve this question by subtracting the number of strings that contain consecutive symbols that are same from the total number of symbols possible of length n.
Let bn denote the number of strings of length n, with consecutive symbols that are same. Then bn can be obtained by 3*bn-1 , since there are 3 choices for appending the string of length n-1 to form a string of length n. So if an denotes the number of strings of length n that do not contain consecutive symbols that are same then, an = 3n - bn-1 . But I am stuck, how do I go from here ? How to solve such problems without generating the sequence and guessing ? I am having a hard time doing so.