Generalizing the Big Omega function to Integral Domains The $\Omega(n)$ function counts the total number of prime factors of $n$ counting multiplicity. Obviously, this definition extends to any Unique Factorization Domain.
I have two follow up questions:


*

*Is it possible to extend the definition to general Integral Domains? For this to make sense we would need that different factorization as irreducible elements always have the same number of irreducibles. For example in $\mathbf Z[\sqrt{-5}]$ the number $6$ factors as both $2*3 = (1+\sqrt{-5})(1-\sqrt{-5})$. However as both factorizations are to exactly $2$ irreducible elements, it seems we'd be able to define $\Omega(6)=2$.
Is there an example for an element in this Integral Domain with two factorizations to a different number of irreducibles?

*Is there an example of an Integral Domain which is not a Unique Factorization Domain but that all factorizations of the same number agree on the number of irreducibles?
 A: As my comment above shows, the natural generalization to an arbitrary integral domain does not work. However, Carlitz proved the following useful theorem:
Theorem (Carlitz, 1960)
Let $\mathcal{O}_K$ denote the ring of integers in a number field $K$. Then the class number of $K$ is at most two if and only if for every $\alpha \in \mathcal{O}_K$, the number of irreducibles in every factorization of $\alpha$ only depends on $\alpha$ (i.e. $\Omega(\alpha)$ would be well-defined).
See L. Carlitz, A characterization of algebraic number fields with class number two, Proc. Amer. Math. Soc. 11 (1960), 391-392, MR0111741, available here.
To return to the example in the question, $\mathbf{Z}[\sqrt{-5}]$ is the ring of integers of $\mathbf{Q}(\sqrt{-5})$ and $\mathbf{Q}(\sqrt{-5})$ has class number 2, so you could reasonably define $\Omega$ in the natural way on $\mathbf{Z}[\sqrt{-5}]$. In particular,
the ring of integers in any field with class number exactly 2 would give you an example of the type of ring you are looking for in your second question.
