Interesting string-arrangement combinatorics Let's think about these rules:

$1. aa \to b, bb \to a. \\ 2. ab, ba, c: \text{erasable.} \\ 3. \text{ If there are no alphabets when you erase all of them with rules over}, \\ \text{we'll say that arrangement $``$empties.$"$}$

Then, show or solve these:
\begin{align}
1. \; & \text{Rather you choose any erasing ways, the result of the arrangement is constant.} \\
2. \; & \text{Find the number of 6-digit empties.}
\end{align}
I found this problem in the olympiad problem book.
These are my attempt:
$\#1$.
\begin{align}
& aaa \to ab \to \varnothing. \\
& aaa \to ba \to \varnothing. \\
\ \\
& bbb \to ab \to \varnothing. \\
& bbb \to ba \to \varnothing. \\
\ \\
& \Rightarrow \; \underbrace{aa\cdots a}_{n-times} \to \begin{cases} a & \text{if } n \equiv 1(\mod 3) \\ b & \text{if } n \equiv -1 (\mod 3) \\ \varnothing & \text{if } n \equiv 0 (\mod 3) \end{cases} \\
\ \\
& \Rightarrow \; \underbrace{bb\cdots b}_{n-times} \to \begin{cases} b & \text{if } n \equiv 1(\mod 3) \\ a & \text{if } n \equiv -1 (\mod 3) \\ \varnothing & \text{if } n \equiv 0 (\mod 3) \end{cases}
\end{align}
No more access I can do from here...
$\# 2. $
\begin{align}
& \text{Recurrence-Relations.} \\
& \text{let } f(n): \text{number of $n$-digit empties.} \\
\Rightarrow \; & f(1)=1(c), f(2)=3(ab, ba, cc). \\
& f(n)=\underset {\text{adding $c$ to any $n-1$-digit empties}} {nf(n-1)} + \underset{\text{adding $ab$ or $ba$ to any $n-2$-digit empties}}{2(n-1)f(n-2)}? \\
& \text{I didn't count some overlapping ones...} \\
\end{align}
I know this question contains two or more questions, but I put these in one because maybe $\#1$ can help solve $\#2$.
 A: The following method might seem not particularly well suited for this problem, I will still
present it since it demonstrates the power of automatons combined with generating functions (alternatively one could just come up with a suitable recurrence as you already attempted).
From the definition of "empties" one obtains the following automaton describing the language over the alphabet $ \{a, b, c\}^{*}$ that accepts "empties":

From this automaton one obtains the following "recursive" set definitions
(formally those sets can be defined by fixed point iterations), namely
$$
\begin{align*}
    &\mathcal{L}_{e} =c \mathcal{L}_{e} \sqcup a\mathcal{L}_{a} \sqcup b \mathcal{L}_{b}
    \sqcup \{ \epsilon \}
    \\[5pt] 
    & \mathcal{L}_{a} = c\mathcal{L}_{a} \sqcup a \mathcal{L}_{b}\sqcup  b\mathcal{L}_{e}
    \\[5pt] 
    & \mathcal{L}_{b} = c \mathcal{L}_{b} \sqcup 
    a \mathcal{L}_{e} \sqcup b \mathcal{L}_{a}
    \\[5pt] 
    & \mathcal{L}_{0} = c \mathcal{L}_{e} \sqcup a\mathcal{L}_{a} \sqcup b\mathcal{L}_{b}
.\end{align*}
$$
(For readability I wrote $a \mathcal{L}$ instead of $\{a\} \times \mathcal{L}$)
Here $\mathcal{L}_{x}$ describes the language of words that are "empties" starting from a word
in state $p_x$.
Converting the above into a linear system of equations involving generating functions we obtain
$$
\begin{align*}
    &G_{e}(z) =z G_{e}(z) + zG_{a}(z) + z G_{b}(z)
    + 1
    \\[5pt] 
    & G_{a}(z) = zG_{a}(z) + z G_{b}(z)+  zG_{e}(z)
    \\[5pt] 
    & G_{b}(z) = z G_{b}(z) + 
    z G_{e}(z) + z G_{a}(z)
    \\[5pt] 
    & G_{0}(z) = z G_{e}(z) + zG_{a}(z) + zG_{b}(z)
.\end{align*}
$$
Which translates into the matrix equation
$$
\begin{align*}
\begin{bmatrix}
G_{e}( z)
\\[2pt] 
G_{a}( z)
\\[2pt] 
G_{b}( z)
\\[2pt] 
G_{0}( z) 
\end{bmatrix} 
= \begin{bmatrix}
    z & z & z  & 0
    \\[2pt] 
    z & z & z & 0
    \\[2pt] 
    z & z & z & 0
    \\[2pt] 
    z & z & z & 0
\end{bmatrix} 
\begin{bmatrix}
G_{e}( z)
\\[2pt] 
G_{a}( z)
\\[2pt] 
G_{b}( z)
\\[2pt] 
G_{0}( z) 
\end{bmatrix} 
+ \begin{bmatrix}
1 \\[2pt] 0\\[2pt] 0\\[2pt] 0 
\end{bmatrix} 
\end{align*}
$$
yielding
$$
\begin{align*}
 \begin{bmatrix}
    1-z& -z & -z  & 0
    \\[2pt] 
    -z & 1-z & -z & 0
    \\[2pt] 
    -z & -z & 1-z & 0
    \\[2pt] 
    -z & -z & -z & 1
\end{bmatrix} 
\begin{bmatrix}
G_{e}( z)
\\[2pt] 
G_{a}( z)
\\[2pt] 
G_{b}( z)
\\[2pt] 
G_{0}( z) 
\end{bmatrix} 
=  \begin{bmatrix}
1 \\[2pt] 0\\[2pt] 0\\[2pt] 0 
\end{bmatrix} 
.\end{align*}
$$
We are interested in $G_{0}( z)$ and through solving the above system (via e.g. gaussian elemination)
one obtains
$$
\begin{align*}
G_{0}( z) = \frac{z}{1 - 3z} \implies \left[ z^{n}\right]G_{0}( z) = 
\left[ z^{n - 1}\right]\frac{1}{1-3z} = 3^{n-1}
.\end{align*}
$$
In particular the number of empties of length $6$ is given by $3^{5}$.
