Length of period of decimal expansion of a fraction

26.9k Views Asked by At

Each rational number (fraction) can be written as a decimal periodic number. Is there a method or hint to derive the length of the period of an arbitrary fraction? For example $1/3=0.3333...=0.(3)$ has a period of length 1.

For example: how to determine the length of a period of $119/13$?

1

There are 1 best solutions below

4
On BEST ANSWER

Assuming there are no factors of $2,5$ in the denominator, one way is just to raise $10$ to powers modulo the denominator. If you find $-1$ you are halfway done. Taking your example: $10^2\equiv 9, 10^3\equiv -1, 10^6 \equiv 1 \pmod {13}$ so the repeat of $\frac 1{13}$ is $6$ long. It will always be a factor of Euler's totient function of the denominator. For prime $p$, that is $p-1$.