This preprint introduces a new integer invariant called the isoperimetric surplus Δ(n). We place n unit tokens on the integer lattice, where each token has a weight equal to its Manhattan distance from the origin plus one. For any integer n we compute two natural “energies”: the rectangular energy, obtained by arranging the tokens into a box whose side lengths come directly from the factorisation of n, the free energy, obtained by arranging them in the most economical (isoperimetric) shape possible – a diamond centred at the origin. The surplus Δ(n) is simply the difference between these two energies. This difference cleanly separates primes from composites: primes always produce a large surplus (roughly proportional to n²/2), while composites with balanced factorisations have a much smaller surplus. The separation becomes even sharper when we move from the plane (Z²) to three-dimensional space (Z³) and beyond. The paper develops the theory in clear stages – first in the first quadrant N², then in the full lattices Z² and Z³ – and ends with a single compact formula that works in any dimension d. Along the way we obtain several exact identities, including the elegant relation that the rectangular energy of a perfect square k² in Z² is exactly the cube k³. This work is a side work of the first published piece of the broader Generalized Arithmetic Energy Theory (GTEA), a framework that links arithmetic structures, geometric arrangements, and their associated energetic costs. We conclude with five open problems, ranging from finer asymptotics to the distribution of the surplus and possible meromorphic properties of its generating function. The preprint is self-contained, richly illustrated, and accessible to readers interested in number theory, discrete geometry, or additive combinatorics.
Sylvain Geffroy (Thu,) studied this question.