Let $a_n$ denote " the number of ternary strings of length n that do not contain three consecutive 1s"
Ternary string contains only 0, 1, 2 and has length n. The way I approached it was to make a tree of length n:
Besides from my obvious lack of artistic skills, I find it very hard to believe that the recurrence relation is $ a_n = 26(a_{n-3}) $ . If anybody could tell me what I did wrong and help me out, that would be greatly appreciated.
Note: I realized that there are some possible duplicates on the site, which I have went through and either 1) do not apply to three consecutive (insert digit here)s or 2) I don't fully understand.