Question about UFD I want to know some examples with the following properies.

Let $R$ be a domain such that every non unit element $x$ is a product of finite irreducible elements, but $R$ is not a UFD, and there is some element $y\in R$ such that $y$ has two distinct factorizations with different lengths.

Textbooks tell me, $\mathbb{Z}[\sqrt{-5}]$ is a non-UFD since $6=2\cdot3=(1+\sqrt{-5})(1-\sqrt{-5})$.
Since $\mathbb{Z}[\sqrt{-5}]$ is Noetherian, then it is easy to show that every non unit element is a product of finite irreducible elements.

But I donot know if every two factorizations of any given element of $\mathbb{Z}[\sqrt{-5}]$ have the same lengths ? That is to ask if this is an example? More, what about general algebraic integer domains ?
What is the famous (easy understood) example that a atomic domain is not a HFD (any two factorizations of any given $x$ have the same length)?

Thanks.
 A: By a classic result of Carlitz, a number ring is a half-factorial domain iff it has class number $1$ or $2$. In particular this is true for $\:\mathbb Z[\sqrt{-5}]\:.\:$ For a proof see Coykendall, Half-factorial domains, a survey.
For a very simple example of a non-HFD consider $\rm\: x\: =\: 2^n\: (x/2^n) \in \mathbb Z + x\ \mathbb Q[x]\:.\:$ More generally it is easy to show that if $\rm\:R\:$ is a subring of a field $\rm\:K\:$ then $\rm\:R + x\ K[x]\:$ is an HFD $\rm\iff\:R\:$ is a field. 
Note also that if a domain is not a UFD then it has an equal-length non-unique factorization , see Coykendall and Smith, Unique factorization domains.
A: The ring of integers of any number field will have the property that elements factor as a finite product of irreducibles. To see this, let $R$ be such a ring of integers and $x$ a nonzero, noninvertible element of $R.$ Then, as $R$ is noetherian, we may choose an ideal maximal among the principal ideals containing $x.$ Any generator of this ideal is irreducible. Let $u_0$ be such a generator. It follows that the ideal $(x)$ factors $(u_0)I$ for some nonzero ideal $I.$ Considering the image of these ideals in the class group of $R,$ we obtain $I$ is principal generated by some element $x_1.$ But the prime factorization of the ideal $(x_1)$ is finite and shorter than the prime factorization of the ideal $(x).$ Thus by an inductive argument, we obtain that every element of $R$ factors as the product of irreducibles. 
Two factorizations of any element will have the same length if and only $R$ has class number 1 or 2. This answers your question about $\mathbb{Z}[\sqrt{-5}].$   
A: Take $R$ to be the ring of polynomials in which the $x$ term does not appear, i.e. polynomials of the form
$$a_0+a_2x^2+...$$
Then by induction on the degree we have that $R$ is an atomic domain, since every element is prime or product of two polynomials with less degree. And if we take the polynomial
$$x^6$$
we have that
$$x^2\cdot x^2 \cdot x^2$$
and 
$$x^3\cdot x^3$$
have different length as desired. (One can easily prove that $x^2$ and $x^3$ are prime in $R$.)
