Reading up on positional notation and converting between different bases, I came across this statement:
For integers p and q with gcd(p, q) = 1, the fraction p/q has a finite representation in base b if and only if each prime factor of q is also a prime factor of b.
I'm trying to construct a proof of such, but all I have so far (not much) is: $$p/q = p\times q^{-1} = p \times \left(\prod\limits_{i}a_i\right)^{-1}$$ where each element $a_i$ is one of $q$'s prime factors. I imagine the next step is converting $\prod\limits_{i}a_i$ to base-$b$, but I'm not sure how to tackle that. Any help?