# If x is a number between 0 and 1, what number results from dropping all odd powers from the binary representation of x?

Let $x$ be a number in the interval $(0,1).$ $x$ has a representation in base 2, using the finite one if the sequence terminates. Clearly we can drop either all the even powers or the odd powers in the reprentation of $x$ in base 2 and thus we can write $x = A+B,$ where numbers $A$ and $B$ are also numbers in the interval $(0,1)$ and $A$ can be represented as a sum of the reciprocals of even powers of $2$ and $B$ can be represented as a sum of the reciprocals of odd powers of $2$. I wish to solve $A$ and $B$.

For example, $\frac{1}{7}=0.001001001001001..._2.$ Dropping off even powers results in $1.000001000001..._2×2^{-6} = \frac{1}{63}$ and for the odd powers we get $0.001000001000001..._2 = \frac{8}{63}.$ Thus $A = \frac{1}{63}$ and $B = \frac{8}{63}.$ Note that $63 = 9\times7.$

Being able to write $A$ using only even powers of $2$ is the same as being able to write $A$ in base 4 using only 0s and 1s and being able to write $B$ using only odd powers of $2$ is the same as being able to write $B$ in base 4 using only 0s and 2s. Indeed, from previous example, $\frac{1}{63} = 0.001001001001001..._4$ and $\frac{8}{63} = 0.02002002002002..._4.$ Thus we can also try to solve $A$ and $B$ such that $x = A + B$ where $A$ has a representation in base 4 using only 0s and 1s and $B$ using only 0s and 2s.

The $A$ and $B$ seem pretty difficult to calculate generally. We had that $\frac{1}{7} = \frac{1}{63} + \frac{8}{63}$ with $63 = 9\times 7$. For the next prime we have $\frac{1}{11} = \frac{85}{1023} + \frac{8}{1023},$ as $1023 = 93\times11.$

Finding either $A$ or $B$ is enough to get both, so: Is there a general method for finding $A$?

• I believe the question not to be a well-defined one, since a number does not necessarily posses an unique representation - but I asume you stick to a finite one when possible. Also tag "elementary-number-theory" is inappropriate, as it is a term generally reserved for studying integers. As to meritum: one cannot help noticing that your construction is somewhat similar to that of a Cantor function. – Michał Zapała Sep 7 '18 at 21:42
• The tag is indeed wrong, thinking about it, I'll remove it. You are of course correct about not having a unique representation, but sticking with the finite representation should be fine, as I understand that to be unique. – Valtteri Sep 7 '18 at 21:50
• Yes, finite representations are clearly unique when existent. BTW, I have a small observation: If $f_a(\cdot)$ is power series with all coefficients equal either $0$ or $1$, such that $f_a(\frac12)=a$ Then the number resulting from your construction equals $\frac{f_a(\frac12)+f_a(-\frac{1}2)}2$ – Michał Zapała Sep 7 '18 at 21:58

One way to represent the result of such dropping seems to be with the series: $$\sum_{n=0}^\infty \frac{\lfloor4^{n+1}x\rfloor-\lfloor4^nx\rfloor}{4^{2n+2}}$$ But this, admittedly, is a rather cheap trick