Solution (source code)

= Solution

The <Dedekind factorization theorem> says that, when a rational prime $p$ does not divide the index of an order $\mathbb Z[\theta]\subseteq\mathcal O_K$, a factorization
$$
\overline f=\prod_i\overline g_i^{e_i}
$$
of the <minimal polynomial> modulo $p$ gives
$$
p\mathcal O_K=\prod_i(p,g_i(\theta))^{e_i}.
$$

Let $K=\mathbb Q(\sqrt d)$ with square-free $d$, and let $p$ be odd. The resulting <splitting of rational primes in a quadratic field> is:
$$
\begin{array}{c|c}
p\mid d & (p)=P^2\quad\text{(ramified)},\\
\left(\frac dp\right)=1 &(p)=(p,\sqrt d-a)(p,\sqrt d+a),
\quad a^2\equiv d\pmod p,\\
\left(\frac dp\right)=-1 &(p)\ \text{is prime}.
\end{array}
$$

Finally suppose $d>0$ and
$\alpha=A/C+(B/C)\sqrt d$ has norm $-1$, with integers
$A,B,C$ chosen <coprime integers>[coprime]. Then
$$
A^2-dB^2=-C^2.
$$
If an <odd integer>[odd] $p\equiv3\pmod4$ <ramification of a prime>[ramified], then $p\mid d$. <Reduction modulo an ideal>[Reduction] modulo $p$ gives
$A^2\equiv-C^2\pmod p$. Since $-1$ is not a <quadratic residue>[square] modulo such a <prime number>[prime], $p\mid A,C$. Dividing the equation's <divisibility> shows $p\mid B$ as well (use that <square-free integer>[square-free] $d$ has <P-adic valuation>[$p$-adic valuation] one), contradicting <coprime integers>[coprimality]. Hence no prime $p\equiv3\pmod4$ ramifies.