spockmonkey40

2022-07-13

Irreducible fraction of a given rational
Given a rational $r\in \mathbb{Q}$, how to find the irreducible fraction $\frac{a}{b}=r$? Any direct formula based on the digits of $r$, instead of successive approximations by increasing numerator and denominator alternatively?

Johnathan Morse

Expert

You have two cases.
If the number of decimals is finite, let's say $x=a.{a}_{1}{a}_{2}...{a}_{n}$. Then obviously
$x=\frac{a{a}_{1}{a}_{2}...{a}_{n}}{{10}^{n}}$
and then you simplify this fraction by looking for common divisors.
If the number of decimals is infinite, then it must have a period $p$, that is
$x=a.{a}_{1}{a}_{2}...{a}_{p}{a}_{1}{a}_{2}...{a}_{p}...$
You have
${10}^{p}x-x=a{a}_{1}...{a}_{p}-a$
and hence
$x=\frac{a{a}_{1}...{a}_{p}-a}{{10}^{p}-1}$
which you can also simplify.

Do you have a similar question?

Recalculate according to your conditions!