Length of smallest repunits divisible by primes

750 Views Asked by At

I want to prove this statement from Wikipedia:

It was found very early on that for any prime p greater than 5, the period of the decimal expansion of 1/p is equal to the length of the smallest repunit number that is divisible by p.

For example, $\cfrac{1}{7}=0.(142857)$, so the period is $6$. And indeed, $\cfrac{R(6)}{7}=15873$, so it seems to be true for at least some primes. But how is this proven for all primes?
My idea was to say (for $p=7$): $$\begin{align} \cfrac{R(6)}{7} & = \cfrac{111111}{7}\\ & =\cfrac{10^7-1}{9\cdot7}\tag{$p$ is coprime to $9$} \\ &\implies 7|10^6-1 \end{align}$$ In general (p>10), this might lead to: $$\begin{align} \cfrac{R(k)}{p} & = n\tag{$n$ is some integer} \\ &\implies p|10^{k}-1 \end{align}$$ So we would have to proof that $p|10^k-1$, where $k$ is the period of $^1/_p$. Is this the right way to prove the statement? If yes, how would I continue, if no, where should I look for a solution? Please just give a hint.

Edit: thanks to lab bhattacharjee, another way of putting it is: prove that $\text{ord}_p(10)$ is equal to the period of $^1/_p$.

1

There are 1 best solutions below

0
On BEST ANSWER

Thanks Erick Wong, I understand it now. So we need $p|10^k-1$, so $$\cfrac{10^k-1}{p}=\cfrac{10^k}{p}-\cfrac{1}{p}=n$$ So we need the fractional parts of $\cfrac{10^k}{p} \text{and}\cfrac{1}{p}$ to be equal: that will happen for the first time if $k=\text{period}_\frac1p$: For example, $$\cfrac{1}{13}=0.(076923) , 10^6\cdot\cfrac{1}{13}=76923.(076923)$$ And the difference is $76923$