Given $0\le x_0<1$, let $$x_n=\begin{cases} 2x_{n-1}, & \text{if $2x_{n-1}<1$}\\ 2x_{n-1}-1, & \text{if $2x_{n-1}\ge 1$} \end{cases}$$ for all integers $n>0$. For how many $x_0$ is it true that $x_0=x_5$?
The answer is supposedly 31.
Does anyone have any suggestions for how I might explore this solution using Mathematica?
Update #1: I want to put a number that is less than 1/2 in binary form. So I tried:
x0 = BaseForm[1./3, 2] Which gave:
$$0.010101010101010101011\ _2$$
Now I want to show what happens when I multiply by 2. I tried:
x1 = 2 x0; BaseForm[x1, 2] But I got:
$$10_2\ 0.010101010101010101011\ _2$$
But what I really wanted it to show is that it moved the decimal point 1 place to the right, that is:
$$0.10101010101010101011\ _2$$
Then I am going to want to show that the same thing happens when I start with a number larger than 1/2 and multiply it by 2 and subtract 1.
