Period of the decimal expression for the rational number $\frac{1}{n}$ is at most $n-1$ Proposition: Show that for an integer $n\geq 2$, the period of the decimal expression for the rational number $\frac{1}{n}$ is at most $n-1$. I'm unsure of where to start. This is my first class on proofs. Do I state:
$\frac{1}{n}=a_n=a_1a_2...a_nb_1b_2...b_n$ with $b$ referring to the repeating part of the expression. I've looked at several other examples but am more confused than aided. I'm unsure how to prove the $n-1$ part. Any help would be appreciated.
 A: When you carry out long division of $1$ by $n$, either the process terminates and you have a finite decimal, or you obtain a sequence of remainders among $1, 2, \dots, n-1$. Once a remainder is repeated, the decimals must start repeating too. Since there are only $n-1$ possible remainders, the repetition must occur by the $n$th decimal place at the latest. The period is then the distance between this and the previous occurrence of the same remainder, which must be at most $n-1$ decimal places.
A: Clearly, it suffices to take $n$ such that $n$ is co-prime with $10$. This is because the periods of $\frac{1}{5k},\frac{1}{2k}$ and $\frac{1}{k}$ are all the same.
So suppose $n>1$ is an integer coprime to $n$.
The period of $n$ is equal to the smallest positive integer $a$ such that $10^a-1$ is a multiple of $n$ (because each of the blocks in the expansion of $\frac{1}{n}$ must yield a sequence of nines when multiplied by $n$).
Notice that $n$ divides $10^{\varphi(a)}-1$. Since $\varphi(a)\leq a-1$ we are done.
Notice that equality holds if and only if $n$ is primes and $10$ is a primitive root $\bmod n$.
