This is a question from a math contest. I want to know if my proof is correct or do I need to add more elements. No answers needed?
Any positive integer can be written in binary (also called base 2). For example, $37$ is $100101$ in binary (because $37 = 2^5 + 2^2 + 2^0$), and $45$ is $101101$ in binary.
Let’s say that a positive integer is "scattered" if, in its binary expansion, there are never two ones immediately next to each other. For example, $37$ is scattered but $45$ is not.
How many scattered numbers are there less than $4$? Less than $8$? Less than $2^n$?
Here is my proof:
First, we see the scattered numbers below $4$ and $8$, as they are not very big numbers, we write a list of them and find out the scattered numbers:
$$0 = 000_2$$$$1=001_2$$$$2=010_2$$$$3 = 011_2$$ $$4=100_2$$$$5=101_2$$$$6=110_2$$$$7=111_2$$$$8=1000_2$$
If we count $0$, we see there are $3$ scattered numbers less than $4$ and $5$ less than $8$.
We see that numbers from $4$ to $7$ are just extensions of the number from $0$ to $3$ with just a ‘$1$’ added in the front. Eg – $0$ is $000$ in base $2$ and $4$ is $100$ in base $2$, so we add a $1$ in the front.
So there are as many scattered numbers from $4$ to $7$ as there are from $0$ to $3$.
We see there are $8$ scattered numbers less than $16$.
So we see a pattern here:
Define $S(x)$ as the number of 'scattered numbers' less than $x$.
We conjecture: $$S(2^n) = S(2^{n-1})+S(2^{n-2})$$