OK my idea is that the total number of possible ternary strings of length $n$ is $3^n$, of which I must subtract the strings containing $000$s plus the strings containing $11$s, excluding the number of duplicates (strings containing both $000$s and $11$s).
Sequence for strings containing 000s: $$f(n)=3\times f(n-1)+2\times(3^{n-4}-f(n-4))$$ Sequence for strings containing 11s: $$f(n)=3\times f(n-1)+2\times(3^{n-3}-f(n-3))$$
Now for the strings containing both sequences: For $n=5$ we get $2$ ($00011$ and $11000$).
For $n=6$ we get $12$ and for $n=7$ we get $73$ (just by producing the permutations).
For $n>5$, I understand we must consider two different cases, the first (or last) $5$ digits forming a "good" sequence (i.e. containing both sequences), in which case, the remaining $n-5$ can be anything (thus giving us $3^{n-5}$ more combinations, or $f(n-1)$ being "bad".
In this case, how do we distinct whether it contains only $000$s or $11$s or none of the two?
In short, how do we find the recurrence relation for the strings to contain both?