TITLE: Is the class number of $K$ the number of factorizations an element of $\mathcal{O}_K$ can have?
QUESTION [5 upvotes]: Consider the number field $K = \mathbf{Q}(\sqrt{-5})$, which has ring of integers $\mathcal{O}_K = \mathbf{Z}[\sqrt{-5}]$. It is known that the class number of $K$ is $2$. It is also true that you can write the element $6$ as a product of irreducible elements in two different ways:
$$ 6 = (1+\sqrt{-5})(1-\sqrt{-5}) = (2)(3).$$
I am noticing that the class number is $2$ and the number of different ways to factor $6$ is also $2$; is this a coincidence, or is this true in general?
That is, if a number field $K$ has class number equal to $k$, can we always find an element $x \in \mathcal{O}_K$ that can be factored into irreducibles in $k$ different ways? Is the class number of a number field $K$ equal to the maximum number of ways an element in $\mathcal{O}_K$ can be factored into irreducibles?

(Here, I am considering two factorizations to be the same if they are equal up to units; e.g: $6 = 2\cdot 3$ and $6 = (-2)*(-3)$ are the "same" factorization in $\mathbf{Z}$.)

REPLY [2 votes]: A less-elementary, but occasionally useful, characterization of having class group $H$ (for a Dedekind domain), is that if we localize so as to kill off ideals generating the ideal class group, then the resulting ring is (still Dedekind and) has class number one (and is a PID). So the number of generators of the class group is the minimum number of prime ideals that must be localized-away to obtain a PID.
EDIT: for example, for $\mathfrak p$ a non-principal ideal, but with $\mathfrak p^n=\alpha\cdot \mathfrak o$ principal (here the classgroup is finite), localize the integers $\mathfrak o$ just a little by adjoining $1/\alpha$. Then there are $\beta_1,\ldots,\beta_n\in\mathfrak p$ whose product is the unit $\alpha$ in $\mathfrak o[1/\alpha]$. So all $\beta_i's$ are units in that localized ring, so $\mathfrak p\cdot \mathfrak o[1/\alpha]=\mathfrak o[1/\alpha]$ has become principal.
In fact, every ideal in $\mathfrak o$ that was equivalent to $\mathfrak p$ in $\mathfrak o$ becomes principal, as well.
Indeed, this may be similar to the device mentioned by @OscarLanzi.