TITLE: What is the Euclidean function for $\mathbb{Z}[\sqrt{14}]$?
QUESTION [19 upvotes]: I've tried a few different pairs of numbers in $\mathbb{Z}[\sqrt{14}]$ and in each case I've been able to find a remainder for which the absolute value of the norm is suitable for the Euclidean algorithm. But the Tooth Fairy tells me that $\mathbb{Z}[\sqrt{14}]$ is not norm-Euclidean. If not the absolute value of the norm, then what is the Euclidean function for $\mathbb{Z}[\sqrt{14}]$? This riddle has me stumped.

REPLY [23 votes]: This ring, as well as all the other number rings that were shown to be Euclidean using analytic techniques, are Euclidean with respect to the minimal Euclidean function $f$, which in your case is defined as follows.
We set $f(r) = 0$ iff $r = 0$.
We set $f(r) = 1$ iff $r$ is a unit, i.e, for elements $\pm (15+4\sqrt{14})^n$.
We set $f(r) = 2$ for all other elements whose residue classes are represented by elements with $f(r) \le 1$. This includes elements of norm $2$ but also
(probably) infinitely many prime elements that have the fundamental unit as a primitive root.
We set $f(r) = 3$ for all other elements whose residue classes are represented by elements with $f(r) \le 2$.
Continue this process indefinitely. It can be shown (but only with analytic means so far) that $f$ is a Euclidean function on ${\mathbb Z}[\sqrt{14}]$.
It is straightforward to compute $f(r)$ for a given element; the difficult problem is showing that every element $r$ has a finite value $f(r)$.
Edit. Perhaps "straightforward" is too strong a word. Let me compute the value $f(7+2\sqrt{14})$ for the element $\pi = 7+2\sqrt{14}$ generating the prime ideal of norm $7$.
I first claim that $f(\pi) \ge 3$. In fact, $\pi$ is not a unit, so $f(\pi) \ge 2$. Next, $\varepsilon = 15 + 4 \sqrt{14} \equiv 1 \bmod \pi$ shows that all units are $\equiv \pm 1 \bmod \pi$, so only the residue classes $0$ and $\pm 1$ are covered by elements with $f(r) \le 1$. But this shows that $f(\pi) \ge 3$.
Next I claim that $f(4 + \sqrt{14}) = f(5 + \sqrt{14}) = 2$. The first element has norm $2$, so the claim is trivial. For the second we observe that $\varepsilon \equiv  -5 \bmod (5 + \sqrt{14})$, and since $-5$ is a primitive root modulo $11$, all the residue classes of $5 + \sqrt{14}$ are represented by units.
For showing that $f(\pi) \le 3$ I have to represent the residue classes $0$, $\pm 1$, $\pm 2$ and $\pm 3$ modulo $\pi$ by elements $r$ with $f(r) \le 2$. This now follows easily as $-2 \equiv 5 + \sqrt{14} \bmod \pi$ and
$-3 \equiv 4 + \sqrt{14} \bmod \pi$.