Does anyone have a nicer closed formula for the Cantor function?

63 Views Asked by At

I just spent this morning working on a closed formula for the Cantor function. Here is what I got: For $x\in[0,1],$ $$c(x)=\sum_{m=1}^\infty\left(\lfloor(3^mt(x)\rfloor-3\lfloor3^{m-1}t(x)\rfloor\right)2^{-m}$$ where $$t(x)=\frac{3^{-n(x)}}{2}\left(\lfloor3^{n(x)}x\rfloor+1\right)$$ and $$n(x)=\sum_{k=1}^\infty\prod_{j=1}^k\big\lvert\lfloor3^jx\rfloor-3\lfloor3^{j-1}x\rfloor-1\big\rvert+1.$$ It essentially comes from the algorithmic definition of the Cantor function. $n(x)$ is the first ternary digit place of x which is 1. It does this by counting up by 1 until the function inside the absolute values hits 0 (i.e. when a digit is 1) and then continues to add 0 after that point. Then $t(x)$ kills the remainder of x past $n(x)$ digits, and switches every 2 digit to a 1. Finally c(x) converts this ternary expansion to a binary expansion, maintaining all the digits. It is extremely clunky, but I imagine every such formula would have to be, does anyone know of a (more than marginally) simpler formula?