FigurateNum generates and visualizes 235+ plane, space, and multidimensional figurate number sequences
From polygonal numbers to Platonic solids and higher-dimensional analogues, FigurateNum unifies 235+ sequences and families of figurate numbers, following Deza & Deza (2012).
Phase portraits in ℂ and modular patterns in ℤₙ, generated with the code below.
Core sequence generators are stable. Visualization modules remain experimental.
# Stable release (sequence generators only)
pip install figuratenum
# Experimental visualization (ComplexViz and DiscreteViz)
# Requires: numpy, sympy, matplotlib
pip install figuratenum[figurate-viz]from figuratenum import FigurateNum
seq1 = FigurateNum().k_dim_centered_hypertetrahedron(4)
print([next(seq1) for _ in range(7)])
# [1, 7, 28, 210, 462, 923, 1709]
seq2 = FigurateNum().k_dim_hyperoctahedron(5)
print([next(seq2) for _ in range(7)])
# [1, 10, 51, 180, 501, 1182, 2471]- Phase portraits of generating functions f(z): ℂ → ℂ in the complex plane, based on Elias Wegert (2012).
- Modular patterns in ℤₙ, inspired by Rogelio Pérez Buendía (2025), generalized here for this family.
from figuratenum.figurate_viz import ComplexViz, DiscreteViz
# Phase portrait of the generating function f(z) in ℂ
c = ComplexViz()
c.visualize_multidim(
"k_dim_centered_hypertetrahedron", k=4,
cmap_color="cividis", disk_radius=2.0
)
# Modular pattern in ℤₙ
d = DiscreteViz()
d.visualize_multidim(
"k_dim_hyperoctahedron", k=5, n_terms=704,
circ_color="m", bg_color="k", num_text=False,
num_color="g", ext_circle=True, rotate=-1
)Sequences are organized by dimension:
- Plane figurate numbers (2D): polygonal, centered polygonal, pronic, and related forms, including their generalized variants.
- Space figurate numbers (3D): pyramidal, polyhedral (tetrahedral, cubic, octahedral, dodecahedral, icosahedral), and centered space forms, including their generalized variants.
- Multidimensional figurate numbers (4D and beyond): hypertetrahedra, hypercubes, hyperoctahedra, and their centered variants for arbitrary dimension
k, including generalized forms.
| Resource | Link |
|---|---|
| Sequence Generators — Full Catalog | sequences.md |
| ComplexViz API Reference | complexviz.md |
| DiscreteViz API Reference | discreteviz.md |
FigurateNum uses optimized implementations of figurate number formulas for performance, while preserving mathematically equivalent results. Original expressions from Deza & Deza (2012) are available via
*_from_book()methods for reference and validation.
Core sequence generators are validated against known closed-form values and classical results from number theory and OEIS.
FigurateNum is under active development. Contributions are welcome: fork the project and submit a pull request.
- New sequences, with a mathematical reference (OEIS, book, or paper).
- Tests for existing sequences.
- Documentation improvements.
- Errata corrections at
docs/errata/errata-figuratenum.tex.
When making commits, use conventional prefixes: feat, refactor, fix, docs, test.
If you use FigurateNum in your research, thesis, or project, please cite it:

