7 is a Heegner number. Therefore the integer ring $O\_K$ corresponding to $K=\mathbb{Q}[\sqrt{-7}]$ is a unique factorization domain. Now, it is easy to show that $\mathbb{Z}[\sqrt{-7}]\subset O\_K$, i.e. $O\_K \neq \mathbb{Z}$, because $x=\sqrt{-7}$ is a solution to $x^2+7=0$. On the other hand, $8=2^3=(1+\sqrt{-7})(1-\sqrt{-7})$. Why is this not a non-unique pair of factorizations? If $O\_K=\mathbb{Z}[\sqrt{-7}]$, its pretty easy to show that $2$ and $1\pm\sqrt{-7}$ are not further factorable (resorting to the fact that the square of the modulus must be integral).


But even if we look at all $\mathbb{Q}[\sqrt{-7}]$, we can show that 2 cannot be factored except trivially.


Where am I going wrong????


Edit: "GH from MO"'s answer is really all you need. But, my second last line above, asserting "2 cannot be factored except trivially" - was wrong. All else above is correct. Last line was not wrong-headed though, the key was to look outside of $\mathbb{Z}[\sqrt{-7}]$, because $O\_K$ is indeed larger. 



Why is this not a non-unique factorization in the integer ring for $\mathbb{Q}[\sqrt{-7}]$ when 7 is a Heegner?
The ring of integers of $\mathbb{Q}(\sqrt{-7})$ is not $\mathbb{Z}[\sqrt{-7}]$ but $\mathbb{Z}\left[\frac{1+\sqrt{-7}}{2}\right]$. In this ring, the ideal $(2)$ factors into prime ideals as follows:
$$ (2)=\left(\frac{1+\sqrt{-7}}{2}\right)\left(\frac{1-\sqrt{-7}}{2}\right). $$
For further information, see [here](https://en.wikipedia.org/wiki/Quadratic_integer#Definition).


