The easiest way to solve this is probably by using recurrence relations.
Let [tex]x_n[/tex] be the number of sequences of length [tex]n[/tex]. Let us consider the left most digit in an [tex]n[/tex] digit valid sequence.
If the left most digit is [tex]0[/tex], the remaining [tex]n-1[/tex] digits can be any valid sequence of [tex]n-1[/tex] digits.
So there are [tex]x_{n-1}[/tex] sequences which begin with [tex]0[/tex].
If the left most digit is [tex]1[/tex], then the three left most digits must be [tex]100[/tex] (otherwise it is not valid). The remaining [tex]n-3[/tex] digits can be any valid sequence.
So there are [tex]x_{n-3}[/tex] sequences which begin with [tex]1[/tex].
This means [tex]x_n = x_{n-1}+x_{n-3}[/tex], by considering the first few cases manually, we can easily determine that [tex]x_1=2, x_2=3, x_3=4[/tex], which gives us enough information to calculate [tex]x_n[/tex] for [tex]n\geq 1[/tex]. For example:
[tex]x_4 = x_3+x_1 = 4+2= 6[/tex],
[tex]x_5 = x_4+x_2 = 6+3= 9[/tex],
[tex]x_6 = x_5+x_3 = 9+4= 13[/tex]
You can create an exact closed form solution for the recurrence relation. It is not difficult to do, but the formula that drops out in this particular case is very ugly and involves complex numbers and cube roots. To see it in all its hideous glory go to
http://www.cs.unipr.it/cgi-bin/purrs_rr ... -3%29&i_c=If we explicitly evaluate the expressions to 12 significant figures, we can get an approximate version of the formula:
[tex]x_n = 1.31342305985 \times
1.46557123188^n+[/tex]
[tex](-0.156711529924 - 0.00134033362014 i) \times
(-0.232785615938 + 0.792551992515 i)^n+[/tex]
[tex](-0.156711529924 + 0.00134033362014 i) \times
(-0.232785615938 - 0.792551992515 i)^n[/tex]
which is a bit nicer.
Hope this helped,
R. Baber.