Here we study a particularly graceful shape, the elliptic curve, and learn that it can be viewed as contour curves describing the surface of—of all things—a doughnut. This delicious insight leads to many important theorems and conjectures, and leads to the dramatic conclusion of the story of Fermat's last theorem.