On this page
A Gaussian integer is a complex number a + bi in which a and b are both ordinary integers, so 3 + 2i counts and 1.5 + i does not (Wikipedia: Gaussian integer). Carl Friedrich Gauss introduced them in 1832, in his second monograph on biquadratic reciprocity, having found that the law of biquadratic reciprocity was easier to state and prove with them than with ordinary whole numbers (same source). They behave enough like whole numbers that you can divide with remainder, find a gcd and factor into primes.
What is the norm of a Gaussian integer?
The norm of a + bi is N(a + bi) = (a + bi)(a − bi) = a² + b², the square of its distance from 0 (Wikipedia: Gaussian integer). If conjugates and modulus are new, our Class 11 key terms for complex numbers covers them. Three facts make the norm the main tool:
It is a whole number, so questions about a + bi become questions about ordinary integers.
It is multiplicative: N(zw) = N(z)N(w). So if z divides w, N(z) divides N(w).
The units, the numbers that divide 1, are the four with norm 1: 1, −1, i and −i.
That gives a fast filter: N(2 + i) = 5 does not divide N(3) = 9, so 2 + i cannot divide 3.
How does division with remainder work for a + bi?
For Gaussian integers a and b, with b not zero, there is a quotient q and remainder r with a = bq + r and N(r) < N(b); you can even make N(r) at most half of N(b) (Wikipedia: Gaussian integer). The recipe: divide as complex numbers, round each part to the nearest integer, keep what is left.
Worked example: divide 27 + 23i by 8 + i.
Multiply top and bottom by the conjugate 8 − i: (27 + 23i)(8 − i) = 216 − 27i + 184i + 23 = 239 + 157i, and N(8 + i) = 65.
The exact quotient is 239/65 + (157/65)i, about 3.68 + 2.42i.
Round each part: q = 4 + 2i.
Multiply back: (8 + i)(4 + 2i) = 32 + 16i + 4i − 2 = 30 + 20i.
Remainder: r = (27 + 23i) − (30 + 20i) = −3 + 3i.
Check: N(r) = 9 + 9 = 18, less than half of 65.
Because the remainder's norm always drops, the Euclidean algorithm ends, just as in Euclid's gcd, step by step. That is what gives Gaussian integers unique factorisation into primes, up to the four units.
Which primes stay prime in the Gaussian integers?
A Gaussian prime is a Gaussian integer, other than 0 and the four units, that is not a product of two non-units. Every ordinary prime p falls into exactly one of three cases (Wikipedia: Gaussian integer):
p leaves remainder 3 on division by 4: p stays prime. These are 3, 7, 11, 19, 23, 31, 43, 47 and so on (OEIS A002145).
p leaves remainder 1: p splits into two conjugate Gaussian primes, as 5 = (2 + i)(2 − i) = 4 + 1 and 13 = (3 + 2i)(3 − 2i).
p = 2: 2 = (1 + i)(1 − i) = −i(1 + i)², the only prime that becomes a square, up to a unit.
Why can't 7 split? If 7 = zw with neither factor a unit, the norms multiply to N(7) = 49, so N(z) = 7, which needs a² + b² = 7. Every square leaves remainder 0 or 1 on division by 4 (Wikipedia: sums of two squares), so a sum of two squares never leaves 3. No such z exists, and the same argument covers 3, 11 and every prime of that type.
Try it:
4 + i: norm 17, a prime, so 4 + i is a Gaussian prime.
3 + 3i: norm 18, not prime; indeed 3 + 3i = 3(1 + i).
29: it leaves remainder 1, and 29 = 25 + 4, so 29 = (5 + 2i)(5 − 2i).
What do Gaussian primes look like?
The picture at the top plots every Gaussian prime with a and b between −11 and 11. It has eight-fold symmetry: changing the sign of a or b, or swapping them, means multiplying by a unit or taking the conjugate, and both keep a prime prime (Wikipedia: Gaussian integer). On the axes sit only ±3, ±7, ±11 and the same numbers times i. The diagonal is empty apart from ±1 ± i, because a + ai has norm 2a², which is prime only when a is ±1.
How do Gaussian primes prove Fermat's two-squares theorem?
Fermat set out the statement that an odd prime is a sum of two squares exactly when it leaves remainder 1 on division by 4, in a letter to Marin Mersenne dated 25 December 1640 (Wikipedia: Fermat's theorem on sums of two squares). Since p = a² + b² is the same as p = (a + bi)(a − bi), "p splits" and "p is a sum of two squares" are one fact read two ways.
One of Richard Dedekind's proofs runs like this (same source). For a prime p that leaves remainder 1, some integer m has p dividing m² + 1 = (m + i)(m − i). For p = 13, m = 5 works: 26 = 2 × 13. But 13 divides neither 5 + i nor 5 − i, so 13 is not a Gaussian prime; by unique factorisation it splits, as (3 + 2i)(3 − 2i), giving 13 = 9 + 4. Our post on Fermat's 1 mod 4 rule tells the same story with ordinary integers.
To practise, split 17, 37 and 41 into conjugate pairs, then divide 41 + 7i by 5 + 2i. If modular arithmetic or complex modulus feels shaky, the Fermi Concept Library covers every concept in mathematics, physics, chemistry, biology and computing. If your remainder keeps coming out too big, the Fermi Problem Library has a step-by-step solver that explains the reasoning, so you can see which step went wrong.



