Converting bases. I would like to know a mathematical way to change between bases of any decimal number to another. I would like it to be able to be programmed.
Examples of problems:
$$\sqrt{2}_{10}=X_{\phi}$$
Here is what I know:
$$3152_b=2.513_{b^{-1}}$$
$$\sum_{n=- \infty}^\infty x b^n=.\overline{x}_b+.\overline{x}_{b^{-1}}$$
Can anyone help me with this?
 A: I have figured it out. First a note:
When I mean round down I mean round towards $-\infty$, and not towards $0$.
The solution:
$$b^{log_{b}(number)}=number$$
so:
$${round\space down(log_{b}(number))}=a\space fraction\space of\space the\space first\space digit$$
To get the answer just loop the equation with an output for each digit:
$$x=round\space down(log_b(Z=Z-b^{return(x)}))$$
The finished process should look something like this:
$$round\space down(log_3(5-3^{1}-3^0-3^0-3^{-\infty}-etc.=0))=-\infty$$
or this if programing it the way like before:
$$number\space positions (1,\space 0,\space 0)$$
This tells you the distance each number is from the $1$'s place.
Finally, you have $1$ for the $3^1$'s, and $2$ for the $3^0=1$'s place:
$$12_3$$
To solve for negative bases use this just use the absolute value of the stuff inside the logarithms. This will cause problems like solutions with this.   
$-7=$ number positions$(1,1,1,0,0)$ for base $-3$ Although it is unlikely for this to set of number positions to appear (unlikely because I haven't checked to see if it would and not that it is inconsistent), so this is a bad example.
This is a problem because the symbol for 3 doesn't exist in base 3. Just like we don't have a symbol for 10 in base 10. We use two symbols.
All you need to do is resolve the 3 (1's) and simplify it. 
Which would yield number positions$(3,2,2,0,0)
$$1202_{-3}$$
