While both user955791's and Michael Burr's solutions are fairly straightforward, here is another.
Consider the Regex for a valid string:
$$1\{0,3\}(01|011|001|0111|0011|0001|00111|00011|000111)^*0\{0,3\}$$
We have sixteen possible combinations of beginnings and endings for our strings with the middle being able to be determined based on solutions to a Diophantine equation.
Let $w_1,\ldots,w_9$ represent the number of $(01),\ldots,(000111)$ respectively in the final string. Then to create any valid string, we can find a multiset where the $w_i$'s are the multiplicity numbers. For beginnings and endings, the total number of digits in the beginnings and endings allows us to group them together.
Let's define some useful notation. For a given choice of $w_i$'s, define $w = \vec{w} = (w_1,\ldots, w_9)$. Then, define the following useful sums and products:
$$D(w) = 2w_1+3(w_2+w_3)+4(w_4+w_5+w_6)+5(w_7+w_8)+6w_9 \\ S(w) = \sum_{i=1}^9 w_i \\ P(w) = \prod_{i=1}^9 (w_i)! \\ f(k) = \begin{cases}1, & k\in \{0,6\} \\ 2, & k\in \{1,5\} \\ 3, & k\in \{2,4\} \\ 4, & k = 3\end{cases}$$
Now, we can write an expression for the total number of valid strings:
$$\sum_{k \in \{0,1,2,3,4,5,6\} \\ \forall i, w_i \in \mathbb{Z}_{\ge 0} \\ D(w) = n-k}f(k)\dfrac{[S(w)]!}{P(w)}$$
Both user955791's and Michael Burr's solutions are probably easier to calculate. But, this should generate the exact same results!
Update:
This is actually easier to calculate than I expected. I wrote a VBA procedure to output to Excel. It calculated the first twenty numbers in a few milliseconds.
<br>
. See this posted question for a model to follow re posting a question at MathSE. – user2661923 May 16 '22 at 10:08