-2

I need to determine whether fraction is recurring decimal or not (what are conditions for it?), find period and output it as $\frac{1}{3}=0.\bar{3}$.

If it is not recurring, then I already have algorithm.

eMathHelp
  • 2,409

1 Answers1

2

Notice that if you have a repeating decimal $$n=0.\overline{D_1D_2...D_k}$$ where each $D_i$ is a digit, you can say that $$10^k n=D_1D_2...D_k.\overline{D_1D_2...D_k}$$ and so $$10^k n-n=D_1D_2...D_k$$ and $$n=\frac{D_1D_2...D_k}{10^k-1}$$ This means that $n$ can only be a repeating decimal if $n$ can be expressed in the form $$n=\frac{a}{10^b-1}$$ and so if you are given a number in the form $$I+\frac{h}{j}$$ Where $I$ is an integer and $j\gt h$, then it can only be a repeating decimal if $j$ evenly divides $10^k-1$ for some $k$. For example, for $j=1,2,5,10$ it will never be a repeating decimal.

Does this help?

Franklin Pezzuti Dyer
  • 39,754
  • 9
  • 73
  • 166