Consider strings of 10 digits; there are $10^{10}$ possible such strings.
Among these strings, there are strings that contain sequence(s) of $n$ consecutive zeroes, for $n\le 10$. For example, $$4000000123$$ is one of the strings that contain a sequence of 6 consecutive zeroes.
I am attempting to find how many strings of 10 digits contains $n$ consecutive zeroes.
My early solution is $(m+1)10^m$ where $m=10-n$, which comes from the following consideration.
First, there is only one string that contains 10 consecutive zeroes, i.e.
$$0000000000$$
Next, there are $2\times 10$ strings that contains 9 consecutive zeroes, that is
$$000000000x, x000000000$$
where $x$ can be any digit. And next, there are $3\times 10^2$ string that contains 8 consecutive zeroes:
$$00000000xy,x00000000y,xy00000000$$
and so on. Therefore, there are $(m+1)10^m$, $m=10-n$, that contains $n$ consecutive zeroes.
But I am not convinced that this solution is correct. Because for $n=0$, i.e. strings that contain any number, I get $11\times 10^{10}$, which is greater than $10^{10}$, the number all possible strings!
What is the reason of this failure and what is the correct solution?