An exercise in number theory: euclidean domain I have an exercise for you about euclidean domain.
Which primes $p<30$ in $\mathbb{Z}$ is a prime in $ \mathbb{Z} \left[ \frac{1+\sqrt{-7}}{2} \right] $ ?
Thank you very much for the support, I appreciate!
 A: Since $ \mathbb{Z} \left[ \frac{1+\sqrt{-7}}{2} \right] $ is an Euclidean domain, it is a $PID$. The minimum polynomial of $\frac{1+\sqrt{-7}}{2}$ is $x^2-x+2 \in \mathbb{Z}[x]$.
Given a prime $p <30$ you have that $p$ is prime in $ \mathbb{Z} \left[ \frac{1+\sqrt{-7}}{2} \right] $ if and only if $(p)$ is a prime ideal, i.e. it is the unique prime ideal appearing in its prime factorization.
To factor the ideal $(p)$ you proceed as follows:
1) Consider $x^2-x+2 \in \mathbb{Z}/p\mathbb{Z}[x]$ and try to factorize it.
2) Every irreducible factor of $x^2-x+2$ corresponds to a prime factor
of the ideal $(p) \subset \mathbb{Z} \left[ \frac{1+\sqrt{-7}}{2} \right]$ 
So $(p)$ is a prime ideal if and only if $x^2-x+2 $ is an irreducible polynomial in $ \mathbb{Z}/p\mathbb{Z}[x]$
For $p=2$ we have $x^2-x = x(x-1)$, so $2$ is not prime.
For $p\geq 3$ we have  that 
$x^2-x+2$ is irreducible $\Leftrightarrow$ its discriminant is not a square in $\mathbb{Z}/p\mathbb{Z}$ $\Leftrightarrow$ $-7$ is not a square modulo $p$.
A: $3, 5, 13, 17, 19$. See A003625 in Sloane's OEIS.
I'm going to assume you meant $\mathbb{Z}[\frac{1}{2} + \frac{\sqrt{-7}}{2}]$. I don't know if you need a proof that $\mathcal{O}_{\mathbb{Q}(-7)}$ is a unique factorization domain, so I'll just assume you know this to be true.
Since $-7 \equiv 1 \mod 4$, we also need to consider so-called "half-integers" $\frac{a}{2} + \frac{b\sqrt{-7}}{2}$ with $a$ and $b$ both odd. However, since $-7 \equiv 1 \mod 8$, the norm of $\frac{a}{2} + \frac{b\sqrt{-7}}{2}$ is an even number, and since there is only one even prime, these "half-integers" need only concern ourselves for
$$2 = \left(\frac{1}{2} - \frac{\sqrt{-7}}{2}\right)\left(\frac{1}{2} + \frac{\sqrt{-7}}{2}\right).$$
And since we're talking about an imaginary ring here, the norm is always nonnegative, and for each prime $p$ we need only solve $p = x^2 + 7y^2$ or show it has no solutions, which we can do by computing the Legendre symbol $\left( \frac{-7}{p} \right)$.
So of course $7 = (-1)(\sqrt{-7})^2$. Then $11 = (2 - \sqrt{-7})(2 + \sqrt{-7})$; $23 = (4 - \sqrt{-7})(4 + \sqrt{-7})$; and $29 = (1 - 2\sqrt{-7})(1 + 2\sqrt{-7})$. The other primes between $1$ and $30$ have no such factorizations and are therefore also prime in $\mathcal{O}_{\mathbb{Q}(-7)}$.
