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,

S3(n)=n(n+1)2,S_3(n) = \frac{n(n+1)}{2},

so S3(1)=1S_3(1) = 1, S3(2)=3S_3(2) = 3, S3(3)=6S_3(3) = 6, S3(4)=10S_3(4) = 10, and so on. Stack them as rows of pebbles and the result is an equilateral triangle.

Square numbers n2n^2 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 mm of the polygon. The general formula for the nn-th mm-gonal number is

Sm(n)=n((m2)n(m4))2.S_m(n) = \frac{n\bigl((m-2)n - (m-4)\bigr)}{2}.

Setting m=3m = 3 recovers the triangular numbers; m=4m = 4 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 AA is called an additive basis of order hh if every nonnegative integer can be expressed as the sum of at most hh elements of AA, with repetitions allowed.

Classical examples include the squares (Lagrange), polygonal numbers (Fermat–Cauchy), and kk-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 kk.

Within each family and dimension, some sequences admit natural extensions to integer indices nZn \in \mathbb{Z}, giving rise to their generalized variants.

Generating functions and analysis

Figurate numbers admit a rational generating function. In general, for (an)n0(a_n)_{n \geq 0}, we have

f(z)=n=1anzn.f(z) = \sum_{n=1}^{\infty} a_n z^n.

For the triangular numbers, f(z)=z(1z)3f(z) = \frac{z}{(1-z)^3}, and for the squares, f(z)=z(z+1)(1z)3f(z) = \frac{z(z+1)}{(1-z)^3}. Both share the denominator (1z)3(1-z)^3 and both vanish at z=0z=0.

For mm-gonal numbers in general, the denominator is always (1z)3(1-z)^3, with mm encoded in the numerator. The degree of the denominator tracks dimension. Pyramidal numbers have (1z)4(1-z)^4, and kk-dimensional analogues have (1z)k+1(1-z)^{k+1}.

ComplexViz renders the phase portrait of f(z)f(z) in C\mathbb{C}, via domain coloring after Wegert (2012). The enhanced phase portrait makes the analytic structure of f(z)f(z) directly readable:

  • poles, typically at z=1z = 1 for these families, where f(z)|f(z)| \to \infty
  • zeros, where f(z)=0f(z) = 0

Both leave characteristic signatures in the coloring.

Modular structure

Instead of the values aka_k themselves, consider their residues modulo a fixed integer nn,

rkakmodn,r_k \equiv a_k \bmod n,

with rk{0,1,,n1}.r_k \in \{0, 1, \ldots, n-1\}. Place nn points evenly on a circle, indexed 00 through n1n-1. Each term aka_k maps to position rkr_k, and consecutive terms are joined by an edge rkrk+1r_k \to r_{k+1}. The resulting orbit (the modular pattern) is what DiscreteViz draws, inspired by Pérez Buendía (2025).

Since (ak)(a_k) is typically polynomial in kk, the residue sequence (rk)(r_k) becomes eventually periodic for any fixed nn, and the orbit closes into a finite cycle in Z/nZ\mathbb{Z}/n\mathbb{Z}.

Symmetry in the resulting pattern depends on the pair (ak,n)(a_k, n) 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.

© 2026 Edgar Delgado Vega