What's an example of an ideal in $\mathbb{Z}[\sqrt{-n}]$ that is not principal?
Solution 1:
If $R$ is a domain and $p$ is an irreducible that is not a prime, then any witness to the fact that $p$ is not a prime yields a witness to the fact that $R$ is not a PID: suppose that $p|ab$, but $p$ does not divide either $a$ or $b$. Then $(p,a)$ is not principal: if $(p,a)=(x)$, then $x|p$; since $p$ is irreducible, either $x$ is a unit, or $x$ is an associate of $p$.
If $x$ is an associate of $p$, then since $(p,a)=(x)$ we have that $x|a$, hence $p|a$, a contradiction.
If $x$ is a unit, then $(p,a)=(x)=(1)$. Therefore, there exist $\alpha,\beta\in R$ such that $1=\alpha p + \beta a$ (since every element of $(p,a)$ is of the form $rp+sa$ for some $r,s\in R$), hence multiplying through by $b$ gives $b=\alpha b p + \beta ab$, and since $p|ab$, it follows that $p|b$. This is another contradiction.
Thus, $(p,a)$ cannot be principal. Of course, neither can $(p,b)$.
Hence, if $n$ is even and $n\gt 2$, then $(2,\sqrt{-n})$ is not principal in $\mathbb{Z}[\sqrt{-n}]$. If $n$ is odd and $n\geq 3$, then $\text{}$$(2,1+\sqrt{-n})$ is not principal.