Generating function of binary string with minimum lengths for 0s and 1s a) Show that the generating function by length for binary strings where every block of 0s has length at least 2, each block of ones has length at least 3 is:
$$\frac{(1-x+x^3)(1-x+x^2)}{1-2x+x^2-x^5}$$
b) Give a recurrence relation and enough initial conditions to determine coefficients of power series.
So for a), I came up with the block decomposition $((0^*00)^*(1^*111)^*)^*$ and found the generating function, using the fact that $0\leadsto x$, $1\leadsto x$, and $a^*\leadsto\frac{1}{1-a}$ where a is some binary string:
$$\frac{(1-x)^2}{(1-x-x^2)(1-x-x^3)}$$
which, clearly, does not equal the expected result. Could someone clear up for me where I went wrong?
Also, for b), how would you find a recurrence relation, since the degree of the numerator and denominator are the same, so there would be no general $a_n$ term.
Thanks in advance for any help!

Let $a_n$ be the number of strings that start with $0$, and let $b_n$ be the number of strings that start with $1$.  Then $a_0=b_0=1$, $a_1=0$, and, by conditioning on the length $k$ of the current run, we see that
\begin{align}
a_n &= \sum_{k=2}^n b_{n-k} &&\text{for $n \ge 2$}\\
b_n &= \sum_{k=1}^n a_{n-k} &&\text{for $n \ge 1$}.
\end{align}
Let $A(z)=\sum_{n=0}^\infty a_n z^n$ and $B(z)=\sum_{n=0}^\infty b_n z^n$.  Then the recurrence relations imply
\begin{align}
A(z)-a_0 -a_1z &=\frac{z^2}{1-z} B(z) \\
B(z)-b_0 &=\frac{z}{1-z} A(z)
\end{align}
Solving for $A(z)$ and $B(z)$ yields
\begin{align}
A(z) &= \frac{1-2z+2z^2-z^3}{1-2z+z^2-z^3}\\
B(z) &= \frac{1-z}{1-2z+z^2-z^3}
\end{align}
So the desired generating function (subtracting the $1z^0=1$ term for the empty string that is otherwise counted twice) is
$$A(z)+B(z)-1=\frac{1-z+z^2}{1-2z+z^2-z^3}.$$
