Prime does not divide index in the ring of integers Suppose $\mathbb{Q}(\alpha)$ is a number field where $\alpha$ is a root of $x^2 - m$ for some $m \in \mathbb{Z}$. Let $p$ be a prime such that $p\mid m$ but $p^2 \nmid m$. I want to show $p \nmid [\mathcal{O}:\mathbb{Z}[\alpha]]$, where $\mathcal{O}$ is the ring of integers of the number field.
I have seen results that give similar more general results, but I am wondering whether there is a direct proof of this fact, as standalone as possible.
 A: Suppose by contradiction that $p$ divides the order of $\mathcal{O} / \mathbb{Z}[\alpha]$. Then by Cauchy's theorem, there exists an element of order $p$ in $\mathcal{O} / \mathbb{Z}[\alpha]$, i.e. there exists $y \in \mathcal{O} \ \backslash \ \mathbb{Z}[\alpha]$ such that $yp \in \mathbb{Z}[\alpha]$. Put $yp= l + n \alpha$ where $n,l \in \mathbb{Z}$.
The minimal polynomial of $l + n \alpha$ over $\mathbb{Q}$ is $x^2-2lx +(l^2 -n^2m)$. Therefore $yp$ satisfies this polynomial and we see that
$$
l^2=n^2m+2lyp-y^2p^2
$$
Since $p \mid m$ we see that $p$ divides the RHS, therefore divides $l^2$ and $l$ since $p$ is prime. Put $l=kp$.
If $p \mid n$, then $y= k + s \alpha \in \mathbb{Z}[\alpha]$ which is a contradiction. Therefore $p \nmid n$ and $y=k+\frac{n}{p}\alpha$ where $\frac{n}{p} \notin \mathbb{Z}$.
Since $y \in \mathcal{O}$, $y-k = \frac{n}{p}\alpha \in \mathcal{O}$ and $\left(\frac{n}{p}\alpha\right)^2 = \frac{n^2m}{p^2}\in \mathcal{O}$. But $p \nmid n$ and $p^2 \nmid m$, so $p^2 \nmid n^2m$ (We use the fact that $p$ is prime). We conclude that $\frac{n^2m}{p^2} \in \mathbb{Q} \ \backslash \ \mathbb{Z}$ and thus is not an algebraic integer, a contradiction.
We always reach a contradiction and we conclude that $p \nmid [\mathcal{O} \ : \ \mathbb{Z}[\alpha] ]$.
Hope I didn't make any mistakes!
