This site is supported by donations to The OEIS Foundation.

Gaussian integers

From OeisWiki
(Redirected from Gaussian integer)
Jump to: navigation, search

This article needs more work.

Please help by expanding it!

A Gaussian integer is a complex number such that the real part is a real integer and the imaginary part is a real integer multiplied by the imaginary unit . Purely real integers may be considered Gaussian integers having an imaginary part of 0. The usual symbol for the ring of Gaussian integers is , but and [1] have also been used. In set notation, we may readily write , but is not a completely straightforward proposition, as well shall see later on.

The complex units 1, , and , have each other as divisors. Gaussian integers with larger real or imaginary parts (or both) have at least 8 divisors. Given a Gaussian integer , a complete listing of its divisors includes at the very least the four complex units, the associates , , and of course itself. If these are the only divisors of that number, then it is a Gaussian prime.

The Gaussian integers form a unique factorization domain. Since multiplication is commutative in (just as it is in , and for that matter), the order of the factors is irrelevant. Thus, ignoring the effect of the units, a Gaussian integer can be factored in only one way.

Theorem. Each Gaussian integer is the product of Gaussian primes having both real and imaginary part positive (and the appropriate complex unit if necessary) in only one way.



We have established that multiplication of real numbers by other real numbers is exactly the same on the complex plane as on the real number line[2] and that is an unique factorization domain just as is (by the fundamental theorem of arithmetic), but it would be a mistake to think that the factorizations of real numbers into real primes are always the same when those real primes are considered as Gaussian integers. In fact, there are numbers in which are not prime at all in . At this point we'll present and prove a fact about prime numbers in and then explain its relevance to Gaussian integers.

Theorem (Fermat). If a prime number is the sum of two perfect squares, then either that prime is 2 or that prime is one more than a multiple of 4. That is to say, if has a solution in integers, then or . Stated yet another way, given the function from Waring's problem that gives the smallest number of th powers to add up to , we have if or .

Proof. The case is disposed easily enough in proof by example: . We take it as axiomatic that all other prime numbers in are odd. Therefore, two distinct squares are required, and furthermore, they must be of opposite parity: either is odd or is. Let's say is an even semiprime and therefore . Thus ; that last congruence will of course also hold if is a multiple of 4 to begin with, so we can set it to the side for now. So, is odd, and there are two possibilities for its congruence to 4: or . By modular arithmetic we see that and also. Therefore , as specified by the theorem.[3]

For example, and .

It turns out that these are precisely the prime numbers of which are composite in . Also, if we know the solution to , we actually also have two of the non-obvious divisors of that prime as a composite Gaussian integer.

Theorem. If a real prime number is the sum of two real perfect squares, then as a Gaussian integer it is actually composite, and those two real perfect squares form the real and the imaginary part respectively of some of that number's non-obvious divisors. This means that if , then .

Proof. First let's remember the rule for complex multiplication: . Thus, to compute , we go: as specified by the theorem. □

Going back to 13 and 53 from our previous examples, we see that and . See A002144 for more examples of these primes that are composite as Gaussian integers. Also notice that .

Just for the sake of thoroughness, let's also consider cases where . Clearly if then is a composite number in . We no longer consider 1 a prime number, and application of the formula given above for divisors gives the rather uninteresting results , which we already knew, once again confirming the removal of 1 from the list of prime numbers as correct.

A point that bears clarification, as it sometimes confuses students, is that while an integer may have one prime factorization in but another in , both of those domains are still unique factorization domains: the prime factorization in one of those domains is not a prime factorization in the other domain. Consider for example 4225, factored as in , but in . The expression does not count as a prime factorization in just as does not count as a prime factorization in either domain; in both cases we're multiplying divisors that happen to be composite in the domain under consideration.


Some number theoretic functions in Mathematica have a Boolean option GaussianIntegers which is set to False by default. For example, FactorInteger[13, GaussianIntegers -> True] would reveal divisors of 13 with a nonzero imaginar part, though this would be formatted closer to the canonical factorization format mentioned above than to the form.

Although Mathematica will assume GaussianIntegers -> True on its own if the imaginary part of an argument to a relevant function is nonzero, it must be explicitly stated for purely real integers even if you actually type out + 0I (so PrimeQ[13 + 0I] would return True because the parser would disregard and the kernel would then regard 13 as an integer in rather than ).

  1. Bolker, p. 117. Technically the symbol is A(–1) as either the author or the editor or the typesetter have eschewed blackboard bold for most of the book save the list of errata.
  2. See Complex numbers#Complex units and identity elements
  3. Ethan D. Bolker, Elementary Number Theory: An Algebraic Approach. Mineola, New York: Dover Publications, 1969, reprinted 2007, 29 — 30. This is actually given as a second proof, simpler than the first, though here I have taken the liberty of fleshing out a few details glossed over by the book. However, the proof Bolker gives first is tremendously simple compared to one given at Planetmath, which manages to mention the rather simplifying question of parity but greatly complicating it.