Gaussian integerA Gaussian integer is a complex number whose real and imaginary part are both integers. The Gaussian integers, with ordinary addition and multiplication of complex numbers, form an integral domain, usually written as Z[i]. This is a Euclidean domain which cannot be turned into an ordered ring.
The norm of a Gaussian integer is the natural number defined as N(a + bi) = a2 + b2. The norm is multiplicative, i.e. N(zw) = N(z)N(w). The units of Z[i] are therefore precisely those elements with norm 1, i.e. the elements 1, -1, i and -i.
The prime elements of Z[i] are also known as Gaussian primes. Some prime numbers are not Gaussian primes; for example 2=(1+i)(1-i) and 5=(2+i)(2-i). Those prime numbers which are congruent to 3 mod 4 are Gaussian primes; those which are congruent to 1 mod 4 are not. This is because primes of the form 4k+1 can always be written as the sum of two squares, so we have p = a2 + b2 = (a + bi)(a - bi). If the norm of a Gaussian integer z is a prime number, then z must be a Gaussian prime, since every non-trivial factorization of z would yield a non-trivial factorization of the norm. So for example 2 + 3i is a Gaussian prime since its norm is 4 + 9 = 13.