
2. For any natural number $n>1$, write the infinite decimal expansion of $1 / n$ (for example, we write $1 / 2=0.4 \overline{9}$ as its infinite decimal expansion, not 0.5 ). Determine the length of the non-periodic part of the (infinite) decimal expansion of $1 / n$.


Solution: For any prime $p$, let $\nu_{p}(n)$ be the maximum power of $p$ dividing $n$; ie $p^{\nu_{p}(n)}$ divides $n$ but not higher power. Let $r$ be the
length of the non-periodic part of the infinite decimal expansion of $1 / n$.

Write

$$
\frac{1}{n}=0 . a_{1} a_{2} \cdots a_{r} \overline{b_{1} b_{2} \cdots b_{s}}
$$

We show that $r=\max \left(\nu_{2}(n), \nu_{5}(n)\right)$.

Let $a$ and $b$ be the numbers $a_{1} a_{2} \cdots a_{r}$ and $b=b_{1} b_{2} \cdots b_{s}$ respectively. (Here $a_{1}$ and $b_{1}$ can be both 0.) Then

$$
\frac{1}{n}=\frac{1}{10^{r}}\left(a+\sum_{k \geq 1} \frac{b}{\left(10^{s}\right)^{k}}\right)=\frac{1}{10^{r}}\left(a+\frac{b}{10^{s}-1}\right)
$$

Thus we get $10^{r}\left(10^{s}-1\right)=n\left(\left(10^{s}-1\right) a+b\right)$. It shows that $r \geq$ $\max \left(\nu_{2}(n), \nu_{5}(n)\right)$. Suppose $r>\max \left(\nu_{2}(n), \nu_{5}(n)\right)$. Then 10 divides $b-a$. Hence the last digits of $a$ and $b$ are equal: $a_{r}=b_{s}$. This means

$$
\frac{1}{n}=0 . a_{1} a_{2} \cdots a_{r-1} \overline{b_{s} b_{1} b_{2} \cdots b_{s-1}}
$$

This contradicts the definition of $r$. Therefore $r=\max \left(\nu_{2}(n), \nu_{5}(n)\right)$.
