# Determine that a number terminates in base m but will not terminate in base n?

• Sep 7th 2008, 07:31 AM
Fourier
Determine that a number terminates in base m but will not terminate in base n?
Is there a way to determine that for some number $a$ in base m that it will or will not have a terminating equivalent number $b$ in base n?

For example, when converting number 0.315 in base 10 to base 2, we get the base 2 number 0.01010000101000111101011100001010... I assume this will be nonterminating. How can I actually prove that this number will be nonterminating?

Thanks
• Sep 7th 2008, 07:47 AM
Laurent
In base $b$, the numbers which "terminate" are of the form $\frac{a}{b^k}$ for some $a,k\in\mathbb{Z}$.

A necessary and sufficient condition for a rational ${p\over q}$, where $p,q$ are relatively prime, to "terminate" in base $b$ is therefore that the prime divisors of $q$ are prime divisors of $b$. (which is equivalent to saying that $q$ divides $b^k$ for some $k$)

For instance, in base 10, ${p\over q}$ "terminates" iff the only prime divisors of $q$ are 2 and 5 (supposing again that $gcd(p,q)=1$). In base 2, $q$ has to be even.

I hope I was clear. If not, just ask.

Laurent.