\(f(x)=\sum^{\lfloor\log_{10}x\rfloor}_{n=0}\Bigl\lfloor\dfrac{x}{10^n}\Bigr\rfloor\operatorname{mod}10\)

look at this in Desmos: https://www.desmos.com/calculator/6tktu9vizl

Thanks for your reply. I want to say that I already know Python and Javascript, and I know how to convert decimal numbers to binary using programming, but I'm interested in doing this mathematically.

The guest above is me - JoshuaGreen. Forgot log in.

You're right. I did not know that the lg (all in one heap) function could be so small. I didn't know that \(\max\left(a,b\right)-\min\left(a,b\right)=\left|a-b\right|\). Thank you.

I also can write the program that reverses the given number but my main target was to write the number reverser using math.