Counting strings with balanced substrings
For a good string $s$ of length $k$, let $M(n,s)$ denote the number of strings of length $n$ terminating in $s$ in which every $k$-letter substring is good. The quantity $M(n,s)$ is given by the following recurrence:
$$
\begin{align}
&amp;M(k,s) = 1 \\
&amp;M(n+1,ta) = M(n+1,tb) = M(n,at) + M(n,bt) \\
&amp;M(n+1,tc) = M(n,ct)
\end{align}
$$
Here $t$ is a string of length $k-1$. Summing over all good strings $s$, we can solve your problem.

Since $a$ and $b$ are really interchangeable, we can also consider a slightly different recurrence, in which $s$ only consists of $a$'s and $c$'s:
$$
\begin{align*}
&amp;M'(k,s) = 2^{\#_a(s)} \\
&amp;M'(n+1,ta) = 2M'(n,at) \\
&amp;M'(n+1,tc) = M'(n,ct)
\end{align*}
$$
Here the second parameter is a "template" in which $a$ stands for either $a$ or $b$.

Using either recurrence, you can find explicit formulas for any given value of $k$.