Is $\mathbb{Z}[√13] $ a Unique factorization domain? I think it is not so as $12 $ can be written in two ways $12=2.6=(1+\sqrt{13})(-1+\sqrt{13})$. Are these two factorization unique upto irreducibles? Please help.
 A: Hint for the title question: We have $${\displaystyle (1+{\sqrt {13}})^{2}=2(7+{\sqrt {13}})}.$$
Since $2$ is irreducible in ${\displaystyle \mathbb {Z} [{\sqrt {13}}]}$ but does not divide ${\displaystyle 1+{\sqrt {13}}}$, we see that ${\displaystyle \mathbb {Z} [{\sqrt {13}}]}$ is not a UFD.
A: $\mathbf{2}$ is Irreducible in $\boldsymbol{\mathbb{Z}\!\left[\sqrt{13}\right]}$
Suppose that
$$
\left(a+b\sqrt{13}\right)\left(c+d\sqrt{13}\right)=2\tag1
$$
where $2\nmid\left(a+b\sqrt{13}\right)$ and $2\nmid\left(c+d\sqrt{13}\right)$. Then
$$
ac+13bd=2\tag2
$$
and
$$
ad+bc=0\tag3
$$
If $2\mid a$, then since $2\nmid\left(a+b\sqrt{13}\right)$, we must have $2\nmid b$. Then $(2)$ says that $2\mid d$ and $(3)$ says that $2\mid c$. However, this means that $2\mid\left(c+d\sqrt{13}\right)$, which contradicts the hypotheses. Therefore, $2\nmid a$. Similarly, $2\nmid c$.
Multiplying $(2)$ by $ac$ and applying $(3)$ to eliminate $d$ gives
$$
a^2c^2-13b^2c^2=2ac\tag4
$$
and therefore,
$$
(ac-1)^2-1\equiv b^2c^2\pmod4\tag5
$$
However, since $a,c\equiv1\pmod2$, we must have $(ac-1)^2-1\equiv3\pmod4$. Since $3$ is not a quadratic residue mod $4$, $(5)$ can have no solutions.
Thus, $2$ is irreducible in $\mathbb{Z}\!\left[\sqrt{13}\right]$.

$\boldsymbol{\mathbb{Z}\!\left[\sqrt{13}\right]}$ is not a UFD
$$
\left(\sqrt{13}-3\right)\left(\sqrt{13}+3\right)=2\cdot2
$$
A: $\mathbb{Z}[\sqrt{13}]$ is not even integrally closed (consider for instance $\displaystyle \frac{3+\sqrt{13}}{2}$), Hence it can't be a principal ideal domain. It also can't be a unique factorization domain because a Dedekind domain is a PID if and only if it is a UFD, but $\mathbb{Z}[\sqrt{13}]$ is not even integrally closed thus not Dedekind. At any rate: if you're not integrally closed then you're not a UFD.
