Set of non-zero elements in ring of integers $\mathcal{O}_K$ in a number field $K$ is diophantine. Let $K$ be a number field (finite extension of $\mathbb{Q}$) and $\mathcal{O}_K$ its ring of integers (elements of $K$ which are integral over $\mathbb{Z}$). It's an exercise in "Undecidability in number theory" (Koenigsmann, 2013, exercise 3.3, arXiv) to show that the set of non-zero elements in $\mathcal{O}_K$ is diophantine. More specifically even, it should hold that for $x \in \mathcal{O}_K$,
$$
x \neq 0 \Leftrightarrow \exists y, z : xz = (2y-1)(3y-1).
$$
The direction from right to left is easy, as $(2y-1)(3y-1)$ can never be equal to $0$ ($2$ and $3$ are not invertible in $\mathcal{O}_K$), but I struggle to prove the other direction, even when $\mathcal{O}_K = \mathbb{Z}$. Both hints and full solutions are welcome.
 A: In $\Bbb Z$ we need to show that for any nonzero number $n$, the congruence
$(2y-1)(3y-1)\pmod n$ is soluble (we may as well suppose $n>0$). 
If either $2$ or $3$ is invertible modulo $n$, this is clear.
But that's enough since by the Chinese Remainder theorem, we may reduce
to the case where $n$ is a prime power, and a prime power can't be divisible
both by $2$ and by $3$.
I think this works in ${\mathcal O}_K$ too. A finite quotient of
${\mathcal O}_K$ will be a direct product of rings of prime power order etc.
A: Reopening this old question, here are the details of the generalization claimed by @Lord Shark the Unknown.
Let now $x ≠ 0$. We can decompose the principal ideal $(x) = \mathfrak x_2
\mathfrak x_3$ such that
$$\def\algint{\mathcal{O}_K}
    (2) + \mathfrak x_2 =
    \algint, \; (3) + \mathfrak x_3 = \algint \, \text{and } \, \mathfrak x_2 +
    \mathfrak x_3 = \algint
$$
hold. This is because $2$ and $3$ are rational primes and therefore
$(2) = 2\algint$ and $(3) = 3\algint$ are relative prime. In other words, we find
$$
      ∃ x_2 ∈ \mathfrak x_2, ∃ y_2 ∈ \algint : 2 y_2 + x_2 = 1 \quad \text{and} \quad
      ∃ x_3 ∈ \mathfrak x_3, ∃ y_3 ∈ \algint : 3 y_3 + x_3 = 1
$$
As a consequence of the Chinese remainder theorem the congruences
$$
      y \equiv y_2 \mod \mathfrak x_2 \quad \text{and} \quad
      y \equiv y_3 \mod \mathfrak x_3
$$
are simultaneously solvable. This implies that
$$
      2 y \equiv 2 y_2 \equiv 1 \mod \mathfrak x_2 \quad \text{and} \quad
      3 y \equiv 3 y_3 \equiv 1 \mod \mathfrak x_3.
$$
Which can be rewritten as
$$
      2 y - 1 ∈ \mathfrak x_2  \quad \text{and} \quad
      3 y - 1 ∈ \mathfrak x_3.
$$
We deduce that $(2 y - 1)(3 y - 1)$ is contained in $\mathfrak x_2
    \mathfrak x_3 = (x)$, or put differently, there exists a $z ∈ \algint$
    such that
$$
  x z = (2 y - 1)(3 y - 1).
$$
