Fundamentals
FigurateNum follows the definitions and organization of the book Figurate Numbers by Elena Deza and Michel Deza (2012), and can serve as a computational companion to it.
Sequences, families, and generating functions documented here correspond directly to those in that work, with corrections tracked in the errata.
The basic idea
Arrange pebbles on a table and some quantities form perfect triangles, others perfect squares. The Pythagoreans noticed this and called the resulting numbers figurate, from the Latin figura (shape): a number that counts the points in a regular geometric arrangement.
The simplest case is the triangular numbers,
so , , , , and so on. Stack them as rows of pebbles and the result is an equilateral triangle.
Square numbers do the same for grids, and the pattern extends to any regular polygon: pentagonal, hexagonal, heptagonal, and beyond. What changes between them is the number of sides of the polygon. The general formula for the -th -gonal number is
Setting recovers the triangular numbers; gives the squares.
From geometry to number theory
The idea is old enough that it has had time to prove itself useful. Diophantus studied figurate numbers in the 3rd century, and over a thousand years later Fermat conjectured that every positive integer is a sum of at most three triangular numbers, four squares, five pentagonal numbers, and so on: the Polygonal Number Theorem.
Gauss proved the triangular case in 1796, writing in his diary: ΕΥΡΗΚΑ! num = Δ + Δ + Δ. The general theorem took until 1813, when Cauchy finally closed it. These results place polygonal numbers in the context of additive number theory.
A set is called an additive basis of order if every nonnegative integer can be expressed as the sum of at most elements of , with repetitions allowed.
Classical examples include the squares (Lagrange), polygonal numbers (Fermat–Cauchy), and -th powers (Waring), while the primes appear in Goldbach-type problems.
Sequences and generating functions by dimension
FigurateNum organizes the 235+ sequences and families into three groups by dimension.
- Plane figurate numbers (2D): polygonal numbers, centered polygonal numbers, pronic numbers, and their relatives. Centered polygonal numbers build outward from a single point, surrounded by successive polygonal shells.
- Space figurate numbers (3D): pyramidal numbers (polygonal numbers stacked as layers) and polyhedral numbers, whose terms count vertices of the Platonic solids: tetrahedral, cubic, octahedral, dodecahedral, icosahedral.
- Multidimensional figurate numbers (4D and beyond): hypertetrahedra, hypercubes, hyperoctahedra, and their centered variants, generalizing the 2D/3D constructions to arbitrary dimension .
Within each family and dimension, some sequences admit natural extensions to integer indices , giving rise to their generalized variants.
Generating functions and analysis
Figurate numbers admit a rational generating function. In general, for , we have
For the triangular numbers, , and for the squares, . Both share the denominator and both vanish at .
For -gonal numbers in general, the denominator is always , with encoded in the numerator. The degree of the denominator tracks dimension. Pyramidal numbers have , and -dimensional analogues have .
ComplexViz renders the phase portrait of in , via domain coloring after Wegert (2012). The enhanced phase portrait makes the analytic structure of directly readable:
- poles, typically at for these families, where
- zeros, where
Both leave characteristic signatures in the coloring.
Modular structure
Instead of the values themselves, consider their residues modulo a fixed integer ,
with Place points evenly on a circle, indexed through . Each term maps to position , and consecutive terms are joined by an edge . The resulting orbit (the modular pattern) is what DiscreteViz draws, inspired by Pérez Buendía (2025).
Since is typically polynomial in , the residue sequence becomes eventually periodic for any fixed , and the orbit closes into a finite cycle in .
Symmetry in the resulting pattern depends on the pair rather than on the sequence alone. A sequence may be symmetric for one modulus and asymmetric for another, while different sequences may exhibit similar patterns under a shared modulus.