FigurateNum
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).
Gallery
Phase portraits in ℂ and modular patterns in ℤₙ, generated with the code below.
Quickstart
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]
Sequence generators
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]
Visualization
- 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
)
Mathematical background
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.
Documentation
| Resource | Link |
|---|---|
| Sequence Generators — Full Catalog | sequences.md |
| ComplexViz API Reference | complexviz.md |
| DiscreteViz API Reference | discreteviz.md |
Implementation Notes
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.
Tests
Core sequence generators are validated against known closed-form values and classical results from number theory and OEIS.
Contributing
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.
Citation
If you use FigurateNum in your research, thesis, or project, please cite it:
Metadata
Release files for figuratenum 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| figuratenum-3.0.0.tar.gz | 59.7 kB | Without provenance | Details for figuratenum-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| figuratenum-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for figuratenum-3.0.0-py3-none-any.whl |
Total release size: 108.3 kB
Release files / figuratenum-3.0.0.tar.gz
| Download URL | figuratenum-3.0.0.tar.gz |
|---|---|
| Size | 59.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c05af6d9b0e85a3ba39a8098c5e323b8ed03f85c93dc5f4bb9f2f43304c8650
|
|
BLAKE2b-256 checksum How to use checksums |
999f108605cefe8aa9a88f754043c8b8cb0f7263fdd3a80658f23fd31bdd6efa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Release files / figuratenum-3.0.0-py3-none-any.whl
| Download URL | figuratenum-3.0.0-py3-none-any.whl |
|---|---|
| Size | 48.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b223adc44d3317ed0be4bc7f948713b8536af76953c0ac3384ced06fd04364d
|
|
BLAKE2b-256 checksum How to use checksums |
d0301a3c8dd0c36d9bc139dce06be489214466478a4665a5144fb0d911685b46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Security for figuratenum 3.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.