How can we check if a certain fraction in a certain base is infinite dizime.
If it is a infinite dizime how can we quickly find the representation of that fraction in that base. The method I have to find its representation is quite slow in some cases and I would like to know if there is a faster method.
The method I have used consistes: Let's say I want to change to base 5. I check if the number ($z$) is between $a*5^n<z<(a-1)*5^n,(0 \le a<5)$ then I subtract $(a-1)*5^n$ and move to a lower base of $5$.
A fraction has an infinite repeat when the denominator (in lowest terms) has a prime factor that does not divide into the base. In base $10$ the fractions that terminate are ones with denominators of the form $2^a5^b$. If there is any other prime in the factorization of the denominator, the fraction will terminate. If it terminates, it will have $\max(a,b)$ places because that is the smallest power of $10$ that $2^a5^b$ divides into.
Your approach to converting a whole number to another base works fine. More commonly taught is to divide the number by $5$ and keep the remainder as the ones digit of the converted number. Divide the quotient by $5$ and keep the remainder as the fives digit. Keep going until you are done. It is described here.