Why does $1$ divided by $p$ have $p-1$ repeating decimals? Part of solving a bigger problem, I discovered that when dividing $1$ with a prime number $p$ > 11, the results has $p-1$ repeating decimals.
Examples: $\dfrac 1{23} = 0.\underline{0434782608695652173913}0434782608695...$
As far as I could tell, this happens for all primes I tested.
I can't at this time see the logic in this, but recall that Euler's Totient Function gives a result of $p-1$ for all primes $p$, so I tested to see if there were any other similarities between ETF and repeating decimals, but as far as I can see, it only "matches" primes.
I've search for more information about this, but have not been lucky yet.
Can anyone elaborate on this "phenomenon"?

Consider $\frac{1}{n}$ in base $m$, where $\gcd(n,m)=1$ for simplicity. We wish to multiply numerator and denominator by a number $k$ so that the denominator becomes $m^e-1$ for some exponent $e$.
Consider powers $1,m,m^2,\cdots$ mod $n$. This sequence repeats. That is, $m$ has some multiplicative order $e$ in the group of units mod $n$. Then $m^e-1=kn$ for some $k$.
We may conclude that
$$\frac{1}{n}=\frac{k}{kn}=\frac{k}{m^e-1}=p^{-e}\frac{k}{1-m^{-e}}=km^{-e}+km^{-2e}+km^{-3e}\cdots $$
Now, $k<m^e$ so is less than $e$ digits in base $m$, so the above exhibits the repeating base $m$ expansion of the fraction $\frac{1}{n}$, with period $e$.
There are $\varphi(n)$ elements in the group of units mod $n$, so the multiplicative order $e$ of $m$ mod $n$ must be a divisor of $\varphi(n)$. When $p$ is prime, $\varphi(p)=p-1$.
