Ordinary integers factor uniquely into primes; the same idea extends to lattices of "algebraic integers" in the complex plane. Whether a rational prime stays prime or splits into a product of ring-primes depends on the field.
Gaussian integers Z[i]: N(a+bi) = a^2 + b^2
Eisenstein integers Z[w]: N(a+bw) = a^2 - a*b + b^2, w = e^(2*pi*i/3)
p = 2 (mod 4) splits in Z[i] as a product of two conjugate Gaussian primes
p = 3 (mod 4) stays prime in Z[i] (inert)
- Number field — switches the lattice: Gaussian integers (square grid) or Eisenstein integers (triangular/hexagonal grid).
- Integer to factor — the ordinary integer n whose factorization in this ring is computed and drawn.
- Factor — highlights the lattice points corresponding to the prime factors found; each highlighted point's norm multiplies out to n.
- Toggle units — shows the finite group of units (points of norm 1) that make a factorization "unique up to units".
This is the machinery behind why some primes (like 5 = (2+i)(2-i)) split into "smaller" pieces once you allow complex integers — a first real example of algebraic number theory's central idea.