# What is the formula for the decimal representation of a/b where b is not coprime to 10? (m)/(10^(phi(b))-1)

What is the formula for the decimal representation of $\frac{a}{b}$ where $b$ is not coprime to 10?
If we want to turn a proper fraction $\frac{a}{b}$ into a decimal, then when $b$ is coprime to 10 we just need to rewrite $\frac{a}{b}$ in the form
$\frac{m}{{10}^{\varphi \left(b\right)}-1}$
where $\varphi$ is Euler's totient function. And then the repeatend is $m$ and the period of repetition is $\varphi \left(b\right)$.
But my question is, what do we do when $b$ is not coprime to 10? In that case we would need to rewrite $\frac{a}{b}$ in the form
$\frac{k+\frac{l}{m}}{{10}^{n}}$
where $k<{10}^{n}$, $\frac{l}{m}$ is a proper fraction, and $m$ is coprime to 10. Then $k$ would be the non-repeating part, $n$ would be the length of the nonrepeating part, and we can convert $l/m$ into a decimal using the procedure given in the beginning of my post.
But is there a formula for the four numbers $k$, $l$, $m$, and $n$ in terms of $a$ and $b$, short of doing long division to convert the fraction into a decimal?
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Kaylee Evans
$\frac{\sqrt{2x+3y}+\sqrt{2x-3y}}{\sqrt{2x+3y}-\sqrt{2x-3y}}=p$
Apply componendo and dividendo,
$\frac{\sqrt{2x+3y}+\sqrt{2x-3y}+\sqrt{2x+3y}-\sqrt{2x-3y}}{\sqrt{2x+3y}+\sqrt{2x-3y}-\sqrt{2x+3y}+\sqrt{2x-3y}}=\frac{p+1}{p-1}$
$\frac{\sqrt{2x+3y}}{\sqrt{2x-3y}}=\frac{p+1}{p-1}$
Put x=y
$\frac{\sqrt{5y}}{\sqrt{-y}}=\frac{p+1}{p-1}$
Squaring both sides,
$5.\left(p-1{\right)}^{2}=-1\left(p+1{\right)}^{2}$
Sorry I have little mistake here, $5{p}^{2}-10p+5=-{p}^{2}-2p-2$
$5{p}^{2}-10p+5=-{p}^{2}-2p-1$
$6{p}^{2}-8p+6=0$
$3{p}^{2}-4p+3=0$
$D={b}^{2}-4ac$
= $\left(-4{\right)}^{2}-4.3.3$ = 16 - 36 = - 20
$p=\frac{-b±\sqrt{D}}{2a}$
= $\frac{-\left(-4\right)±\sqrt{-20}}{2.3}$
= $\frac{4±\sqrt{20{i}^{2}}}{6}$
= $\frac{4±2i\sqrt{5}}{6}$
p = $\frac{2+i\sqrt{5}}{3},\frac{2-i\sqrt{5}}{3}$
Edit-
In above formula D is discriminat. It is used when we can't factorise equation using factorisation method.