period of recurring decimals

1.6k Views Asked by At

The period of a recurring decimal fraction $1/d$ is equal to the multiplicative order of $10$ mod $d$.

For fractions with even period, the digits sum to 9 i.e.

$1/7 = 0.(142857)...$

$$142\\ 857\\ \_\_\_\\ 999$$

It seems every prime number has that property. Can somebody please point me to a proof of that ?

Also. what's the relation between the period of $1/mn$ and that of $1/m$ and $1/n$ ?

PS : see problem 26 in projectEuler

1

There are 1 best solutions below

2
On

Consider doing the long division of $1$ by $p$ where $p$ is a prime. As you do the division, you will get $p-1$. After this the process repeats with each digit $d$ replaced by $10-d$.

Example: $$ 10/7 = 1, ~\text{Remainder} = 3\\ 30/7 = 4, ~\text{Remainder} = 2\\ 20/7 = 2, ~\text{Remainder} = 6 $$ Since $6=7-1$ we can stop. We have up to this point the digits 1,4,2. So the remaining digits are 8,5,7, i.e. $$ 1/7 =0.142857 \,142857 \,142857 \,\cdots $$ Try the same for $1/17$ You will get the digits $05882352$ and remainder 16. You can verify this from $$ 17 \times 5882352 + 16 = 100000000 $$ Hence $$ 1/17 = 0.05882352|94117647 \,0588235294117647\, 05882352|94117647 $$ where I have drawn a $|$ to show where the second half of the digits come.

More formally,

$$\frac{1}{7} = 0.142 + \left(1-\frac{1}{7}\right)\times 10^{-3}$$

Applying the above equation recursively,

$$\frac{1}{7} = 0.142 + \left(1- \left(0.142 + \left(1-\frac{1}{7}\right)\times 10^{-3}\right)\right)\times 10^{-3}$$ $$\implies \frac{1}{7} = 0.142 + \left(1- 0.142\right)\times 10^{-3} - \left(1-\frac{1}{7}\right)\times 10^{-6}$$ $$\implies \frac{1}{7} = 0.142857\bar{9} - \left(1-\frac{1}{7}\right)\times 10^{-6} = 0.142857 + \frac{1}{7}\times 10^{-6} $$