Unique factorization in $\mathbb Z(\sqrt{-19})$ An elementary confusion about class number: 
In $\mathbb Z(\sqrt{-19})$ we have $N(1+\sqrt{-19}) = (1+\sqrt{-19})(1-\sqrt{-19}) = 2^2\cdot 5.$ 
I see that 2 and 5 are irreducible, 4 is not. 
In a UFD a non-zero, non-unit element can be factored uniquely (up to associates) as a finite product of irreducibles. What is it about the two factorizations of 20 above that prevents them from being non-trivial distinct factorizations into a finite product of irreducibles? 
Thank you. 
 A: That's because $\mathbb{Z}[\sqrt{-19}]$ is not integrally closed. Since $-19 \equiv 1 \pmod 4$, numbers of the form $\frac{a}{2} + \frac{b \sqrt{-19}}{2}$ (with $a$ and $b$ of the same parity) are also algebraic integers. Observe that $$\left(\frac{1}{2} - \frac{\sqrt{-19}}{2}\right)\left(\frac{1}{2} + \frac{\sqrt{-19}}{2}\right) = 5.$$ The former factor is an algebraic integer with minimal polynomial $x^2 - x + 5$, and the latter factor has the same minimal polynomial. This means that in $\mathcal{O}_{\mathbb{Q}(\sqrt{-19})}$, 5 is actually "composite"! It should also be clear that $1 + \sqrt{-19}$ is also reducible; to claim it as a prime factor of 20 in $\mathcal{O}_{\mathbb{Q}(\sqrt{-19})}$ would be just as erroneous as saying 10 is a prime factor of 20 in $\mathbb{Z}$. The complete factorization of 20 in $\mathcal{O}_{\mathbb{Q}(\sqrt{-19})}$ is then $$2^2 \left(\frac{1}{2} - \frac{\sqrt{-19}}{2}\right)\left(\frac{1}{2} + \frac{\sqrt{-19}}{2}\right) = 20.$$
A: I'm going to try to take your question more literally than the others who've answered so far. I'm going to assume that by "$\mathbb{Z}(\sqrt{-19})$" you mean only the numbers of the form $a + b \sqrt{-19}$, where $a$ and $b \in \mathbb{Z}$. (I can't remember if it's in Stewart & Tall's book on the Fermat-Wiles theorem or maybe Watkins that there's a similar exercise with numbers of the form $a + b \sqrt{5}$, but the notation used for the ring is definitely not "$\mathbb{Z}(\sqrt{5})$").
In "$\mathbb{Z}(\sqrt{-19})$", the $\mathbb{Z}$-primes $2, 3, 5, 7, 11, 13, 17$ must be inert, $19$ ramifies (as $(-1)(\sqrt{-19})^2$, $23$ splits as $(2 - \sqrt{-19})(2 + \sqrt{-19})$ and after that the others might either split or stay inert. The factorization of $20$ from $\mathbb{Z}$ carries over to "$\mathbb{Z}(\sqrt{-19})$": $20 = 2^2 \times 5$, with three prime factors.
But as you noticed, $20$ also splits as $(1 - \sqrt{-19})(1 + \sqrt{-19})$. These two factors are irreducible in "$\mathbb{Z}(\sqrt{-19})$". I leave this to you to check, but I will tell you that they are not associates of either $2$ or $5$: $\frac{1 - \sqrt{-19}}{2}$ is outside of "$\mathbb{Z}(\sqrt{-19})$", as is $\frac{1 - \sqrt{-19}}{5}$.
The inescapable conclusion here is that this "$\mathbb{Z}(\sqrt{-19})$" is not a unique factorization domain and its class number can't be $1$ (or $2$ for that matter). Understandably confusion will arise when you look up $-19$ in a table of class numbers for quadratic rings and see a $1$ rather than $3$ or higher.
That's because they're not talking about "$\mathbb{Z}(\sqrt{-19})$". They're talking about all numbers of the form $n = a + b \sqrt{-19}$, where $a$ and $b \in \mathbb{Q}$ (not just $\mathbb{Z}$) such that $n$ is an algebraic integer. This concept of algebraic integers is very important in algebraic number theory.
The ring of algebraic integers within $\mathbb{Q}(\sqrt{-19})$ may be notated a few different ways: $\mathcal{O}_{\mathbb{Q}(\sqrt{-19})}$, $\textbf{Z}\left[ \frac{1 - \sqrt{-19}}{2} \right]$, $\mathbb{Z}\left[ \frac{1}{2} + \frac{\sqrt{-19}}{2} \right]$, etc. Some may first define $K = \mathbb{Q}(\sqrt{-19})$ and then refer to $\mathcal{O}_K$. Others may define $u = \frac{1 + \sqrt{-19}}{2}$ and then refer to $\mathbb{Z}[u]$. The important point is to show that you're aware of numbers of the form $\frac{a}{2} + \frac{b \sqrt{-19}}{2}$.
A: Let $u = \frac{1+ \sqrt {-19}}2$. $u$ is an algebraic integer (because $u^2 = u-5$). And so the ring of integers of $\Bbb Q(\sqrt {-19})$ is $\Bbb Z[u]$ and not $\Bbb Z[\sqrt{ -19}]$.
$\Bbb Z[u]$ has unique factorisation. For example, $u$ and $1-u$ are irreducible, and $5$ factors as $u(1-u)$. 
