How to determine which classes of integral domains a quadratic integer ring is in? [duplicate]

The "integers" of quadratic field $\mathbb Q[\sqrt{d}]$ , for a squarefree integer $d$ , forms an integral domain . I know that for $d<0$ , the quadratic integers of the quadratic number fields satisfy Euclidean algorithm only for $d=-1,-2,-3,-7,-11$ . I want to know , for which $d<0$ , it is true that every ideal of the integral domain of quadratic integers of $\mathbb Q[\sqrt{d}]$ is a principal ideal , that is when is the subring of quadratic integers of imaginary quadratic number fields is a PID ? I want to know this as PID do not imply ED but does imply UFD . Please help . Thanks in advance


With $d<0$, the ring of integers of $\mathbb Q(\sqrt d)$ is a PID exactly when $$d= −1, −2, −3, −7, −11, −19, −43, −67, −163$$ Checking that these rings are PIDs is not too hard, but checking that no other values give an integer ring that is a PID requires some heavy machinery - see the class number 1 problem.