The proof I do not understand is the proof to statement (2). Below I describe exactly what my problem is.

[![enter image description here](https://i.stack.imgur.com/huTkH.jpg)](https://i.stack.imgur.com/huTkH.jpg)

He shows that $n$ divides $im$, or equivalently $\frac{im}{n} \in \mathbb{Z}$. This is fine, I understand this. The particular part I don't understand is the following: he claims that $\frac{n}{\textrm{hcf}(i,n)}$ divides $m$. It seems to me this doesn't follow, for the following reason:

$$\frac{m}{\left(\frac{n}{\textrm{hcf}(i,n)}\right)} = \frac{im}{\left(\frac{in}{\textrm{hcf}(i,n)}\right)} = \frac{im}{n} \frac{1}{\left( \frac{i}{\textrm{hcf}(i,n)} \right)}$$

The $im/n$ is an integer, $i/\textrm{hcf}(i,n)$ is an integer, but there is no reason to think that their ratio is an integer. So I don't understand why $\frac{n}{\textrm{hcf}(i,n)}$ divides $m$.