When is $\mathbb Z[\sqrt d]$ a Euclidean or principal ideal domain? Let $d$ be an integer $\neq 1$ such that $d$ is not divisible by the power of any prime.Consider the ring $\mathbb Z[\sqrt d]$.My question is when is this ring a Euclidean domain,and when it is not an ED,when is this ring a PID?Is there any criterion to ensure this?How to understand by observation?
Note that $d$ may be negative also.
 A: *

*There is no simple rule that classifies when $\mathbf Z[\sqrt{d}]$ is a PID or Euclidean when $d$ is squarefree and positive, and there is no reason to expect a simple rule. (But note, as Gerry Myerson points out, that $\mathbf Z[\sqrt{d}]$ is the "wrong ring" to be thinking about when $d \equiv 1 \bmod 4$ since the full ring of algebraic integers of $\mathbf Q(\sqrt{d})$ in that case is the bigger ring $\mathbf Z[(1+\sqrt{d})/2]$. The ring $\mathbf Z[\sqrt{d}]$ is never a UFD for $d \equiv 1 \bmod 4$ for structural reasons.)


*The list of norm-Euclidean real quadratic rings is known. See the Wikipedia page for quadratic integers, but note that it is about when the full ring of integers is norm-Euclidean. That is never $\mathbf Z[\sqrt{d}]$ when $d \equiv 1 \bmod 4$, so if you discard such $d$ then you are left with $d = 2, 3, 6, 7, 11, 19$. Note that being a Euclidean domain is a weaker property than being norm-Euclidean: maybe the ring is Euclidean with respect to some bizarre function, not its (absolute) norm function.  An example of that is $\mathbf Z[\sqrt{14}]$, which is not norm-Euclidean but was proved to be Euclidean by Malcolm Harper.


*If you want to accept the Generalized Riemann Hypothesis for zeta-functions of number fields, then PID = Euclidean for real quadratic rings of algebraic integers. For example, if $d$ is positive, squarefree, and not $1 \bmod 4$ then $\mathbf Z[\sqrt{d}]$ is Euclidean (not necessarily norm-Euclidean!) if and only if it is a PID. Neither of these properties is easy to characterize, but the properties are equivalent to each other if you accept GRH.  This is a special case of a theorem of Weinberger in 1973: GRH for zeta-functions of all number fields implies the ring of integers $\mathcal O_K$ of a number field $K$ is Euclidean if it is a PID (has class number $1$) and the unit group $\mathcal O_K^\times$ is infinite. Weinberger's paper is
On Euclidean rings of algebraic integers, pp. 321-332 in
"Analytic number theory'' (Proc. Sympos. Pure Math., Vol. XXIV).
Amer. Math. Soc., Providence (1973).
