in the ring $\mathbb{Z}[i]$ we have the units are $\{\pm 1\,\pm i\}$ and for $p\neq2$ , $p$ is prime if the $N(p)=a^2+b^2$ is prime and $p\equiv 1 \pmod4$
My Question is there any algorithm able to test given $p=a+ib$ is prime or not ?
in the ring $\mathbb{Z}[i]$ we have the units are $\{\pm 1\,\pm i\}$ and for $p\neq2$ , $p$ is prime if the $N(p)=a^2+b^2$ is prime and $p\equiv 1 \pmod4$
My Question is there any algorithm able to test given $p=a+ib$ is prime or not ?
Wait, there are three kinds of primes (up to units) in the Gaussian integers \begin{cases} 1 + i\\ \text{$q$, a prime integer with $q \equiv 3 \pmod{4}$}\\ \text{$a + i b$, where $r = a^{2} + b^{2}$ is a prime integer, $r \equiv 1 \pmod{4}$} \end{cases}
So the algorithm is immediate, provided you can recognize prime integers efficiently.
Of course this is up to units, for instance $$ 1 + i, - 1 - i , i(1 + i) = -1 + i, (-i)(1 + i) = 1 - i $$ are all prime.