Can we specifically prove that if $n\in\mathbb{Z^+}$ is composite and square-free then the ring of integers of $\mathbb{Q}(\sqrt{-n})$ is not a UFD? Let $\mathcal{O}_K$ be the ring of integers of a field $K$. I have learnt about the Baker-Heegner-Stark theorem, which implies that if $K=\mathbb{Q}(\sqrt{-n})$ with $n\in\mathbb{Z}^+$ square-free, then $\mathcal{O}_K$ is a UFD if and only if $n$ is a  Heegner number. However, I am interested in the possibility of obtaining an easier result: is it possible to prove that all Heegner numbers greater than $1$ are primes, with undergraduate mathematics?

This is not quite enough. It could be that the two factorizations can each be refined into the same factorization. 
