Given a rational number $\frac{n}{d}$, I understand that in the base $10$ number system, the number can be represented as a non-repeating decimal number if and only if $d$ has only prime factors of $2$ and $5$.
I have a hypothesis that the reason for this is because $2$ and $5$ are the prime factors of $10$, which is the base for our number system. So according to my hypothesis, on a base $6$ number system, a rational number could be represented as a non-repeating decimal if and only if the denominator's only prime factors are $2$ and $3$.
But this is just a hypothesis, I don't know exactly why it is true. I'm not sure what the connection is between the prime factors of the base, and whether or not a rational number will be a repeating decimal. Can someone demonstrate why this holds true?
If $b$ is the base, then a non repeating number $n/d$ is of the form $$ \frac{n}{d}=\frac{a}{b^k} $$ where I assume that $n$ and $d$ have no common factors. Also we can assume $k>0$ or the fraction $n/d$ would already be an integer.
This means $$ nb^k=ad. $$ If $p$ is a prime factor of $d$, then $p$ divides $nb^k$, but it can't divide $n$ so it must divide $b^k$, hence $b$.
Here I use the well known property of prime integers: if $p$ is prime and $p$ divides $xy$, then $p$ either divides $x$ or $y$.