What is the formula for the decimal representation of where is not coprime to 10?
If we want to turn a proper fraction into a decimal, then when is coprime to 10 we just need to rewrite in the form
where is Euler's totient function. And then the repeatend is and the period of repetition is .
But my question is, what do we do when is not coprime to 10? In that case we would need to rewrite in the form
where , is a proper fraction, and is coprime to 10. Then would be the non-repeating part, would be the length of the nonrepeating part, and we can convert into a decimal using the procedure given in the beginning of my post.
But is there a formula for the four numbers , , , and in terms of and , short of doing long division to convert the fraction into a decimal?