Consider a binary alphabet $D =\{0,1\}$. We want to determine number of binary string with length $n$, where every blocks of $1$s has even length. For example for $n = 4$ we have $0000$, $1100$, $0110$, $0011$, $1111$ - $5$ different variants.
My approach was to construct regular expression to determine this sequence. Let $\lambda = \emptyset$. Hence we have $(11\cup\lambda)(0^*(11)^*)^*$. Now we have generating function : $\frac{(x^2+1)(1-x)(1-x^2)}{(1-x)(1-x^2)-1}$, which doesn't correct (we may represent this function for series and find coefficient).
Maybe there is a simpler approach ? Or how can we find correct regexp?