Fignumbers is a comprehensive TypeScript library for generating and exploring infinite figurate number sequences, linked to geometric shapes across multiple dimensions.
Based on the book Figurate Numbers (2012) by Elena Deza and Michel Deza, this library covers a broad range of figurate number sequences. This academic foundation ensures its reliability and precision for use in various fields:
- Mathematical projects
- Visualization
- Algorithmic applications
- Any work involving figurate number sequences
It is precise and type-safe, but performance may not be as optimized as smaller number types, since bigint operations are typically slower than traditional number operations.
First, make sure you have the library installed via npm:
npm install fignumbers
- Fignumbers utilizes
BigInt
to manage large integers that exceed theNumber
type limit of(2^53 - 1)
. Ensure that your environment supports BigInt before using this library.
Fignumbers is structured around three main classes, each corresponding to a different spatial dimension, as described in the book:
- PlaneFigNumbers โ 121 sequences
- SpaceFigNumbers โ 133 sequences
- MultiDimensionalFigNumbers โ 191 sequences
Together, these classes implement a total of 445 figurate number sequences.
// 1. Import the library
import { SpaceFigNumbers } from "fignumbers";
// 2. Configure parameters for the generator (use bigints for precision!)
const config = { start: 1n, m: 5n, step: 1n };
// 3. Choose the type of space figurate number you want (pyramidal, cubic, etc.)
const pyramidalSequence = new SpaceFigNumbers("pyramidal");
const pyramidalNumbers = pyramidalSequence.generate(config);
// 4. Get ready to see the magic happen! First 7 pyramidal numbers with m = 5n:
console.log("First 7 pyramidal numbers with m = 5n:");
for (let i = 0; i < 7; i++) {
const nextNumber = pyramidalNumbers.next().value; // Grab the next number in the sequence
console.log(`Number ${i + 1}: ${nextNumber}`);
}
First 7 pyramidal numbers with m = 5n:
Number 1: 1n
Number 2: 6n
Number 3: 18n
Number 4: 40n
Number 5: 75n
Number 6: 126n
Number 7: 196n
- polygonal
- centeredPolygonal
- truncatedCenteredPolygonal
- pronic
- truncatedPronic
- polite
- impolite
- aztecDiamond
- gnomic
- cross
- polygram
- triangular
- square
- pentagonal
- hexagonal
- heptagonal
- octagonal
- nonagonal
- decagonal
- hendecagonal
- dodecagonal
- tridecagonal
- tetradecagonal
- pentadecagonal
- hexadecagonal
- heptadecagonal
- octadecagonal
- nonadecagonal
- icosagonal
- icosihenagonal
- icosidigonal
- icositrigonal
- icositetragonal
- icosipentagonal
- icosihexagonal
- icosiheptagonal
- icosioctagonal
- icosinonagonal
- triacontagonal
- centeredTriangular
- centeredSquare
- centeredPentagonal
- centeredHexagonal
- centeredHeptagonal
- centeredOctagonal
- centeredNonagonal
- centeredDecagonal
- centeredHendecagonal
- centeredDodecagonal
- centeredTridecagonal
- centeredTetradecagonal
- centeredPentadecagonal
- centeredHexadecagonal
- centeredHeptadecagonal
- centeredOctadecagonal
- centeredNonadecagonal
- centeredIcosagonal
- centeredIcosihenagonal
- centeredIcosidigonal
- centeredIcositrigonal
- centeredIcositetragonal
- centeredIcosipentagonal
- centeredIcosihexagonal
- centeredIcosiheptagonal
- centeredIcosioctagonal
- centeredIcosinonagonal
- centeredTriacontagonal
- truncatedCenteredTriangular
- truncatedCenteredSquare
- truncatedCenteredPentagonal
- truncatedCenteredHexagonal
- truncatedCenteredHeptagonal
- truncatedCenteredOctagonal
- truncatedCenteredNonagonal
- truncatedCenteredDecagonal
- truncatedCenteredHendecagonal
- truncatedCenteredDodecagonal
- truncatedCenteredTridecagonal
- truncatedCenteredTetradecagonal
- truncatedCenteredPentadecagonal
- truncatedCenteredHexadecagonal
- truncatedCenteredHeptadecagonal
- truncatedCenteredOctadecagonal
- truncatedCenteredNonadecagonal
- truncatedCenteredIcosagonal
- truncatedCenteredIcosihenagonal
- truncatedCenteredIcosidigonal
- truncatedCenteredIcositrigonal
- truncatedCenteredIcositetragonal
- truncatedCenteredIcosipentagonal
- truncatedCenteredIcosihexagonal
- truncatedCenteredIcosiheptagonal
- truncatedCenteredIcosioctagonal
- truncatedCenteredIcosinonagonal
- truncatedCenteredTriacontagonal
- pentagram
- hexagram
- heptagram
- octagram
- nonagram
- decagram
- hendecagram
- dodecagram
- tridecagram
- tetradecagram
- pentadecagram
- hexadecagram
- heptadecagram
- octadecagram
- nonadecagram
- icosagram
- icosihenagram
- icosidigram
- icositrigram
- icositetragram
- icosipentagram
- icosihexagram
- icosiheptagram
- icosioctagram
- icosinonagram
- triacontagram
- pyramidal
- tetrahedral
- cubic
- octahedral
- dodecahedral
- icosahedral
- centeredMgonalPyramidal
- centeredMgonalPyramid
- centeredTetrahedron
- centeredCube
- centeredOctahedron
- centeredDodecahedron
- centeredIcosahedron
- truncatedTetrahedral
- truncatedCubic
- truncatedOctahedral
- centeredTruncatedTetrahedron
- centeredTruncatedCube
- centeredTruncatedOctahedron
- stellaOctangula
- rhombicDodecahedral
- hauyRhombicDodecahedral
- mgonalPrism
- triangularPyramidal
- squarePyramidal
- pentagonalPyramidal
- hexagonalPyramidal
- heptagonalPyramidal
- octagonalPyramidal
- nonagonalPyramidal
- decagonalPyramidal
- hendecagonalPyramidal
- dodecagonalPyramidal
- tridecagonalPyramidal
- tetradecagonalPyramidal
- pentadecagonalPyramidal
- hexadecagonalPyramidal
- heptadecagonalPyramidal
- octadecagonalPyramidal
- nonadecagonalPyramidal
- icosagonalPyramidal
- icosihenagonalPyramidal
- icosidigonalPyramidal
- icositrigonalPyramidal
- icositetragonalPyramidal
- icosipentagonalPyramidal
- icosihexagonalPyramidal
- icosiheptagonalPyramidal
- icosioctagonalPyramidal
- icosinonagonalPyramidal
- triacontagonalPyramidal
- centeredPentagonalPyramid
- centeredHexagonalPyramid
- centeredHeptagonalPyramid
- centeredOctagonalPyramid
- centeredNonagonalPyramid
- centeredDecagonalPyramid
- centeredHendecagonalPyramid
- centeredDodecagonalPyramid
- centeredTridecagonalPyramid
- centeredTetradecagonalPyramid
- centeredPentadecagonalPyramid
- centeredHexadecagonalPyramid
- centeredHeptadecagonalPyramid
- centeredOctadecagonalPyramid
- centeredNonadecagonalPyramid
- centeredIcosagonalPyramid
- centeredIcosihenagonalPyramid
- centeredIcosidigonalPyramid
- centeredIcositrigonalPyramid
- centeredIcositetragonalPyramid
- centeredIcosipentagonalPyramid
- centeredIcosihexagonalPyramid
- centeredIcosiheptagonalPyramid
- centeredIcosioctagonalPyramid
- centeredIcosinonagonalPyramid
- centeredTriacontagonalPyramid
- centeredTriangularPyramidal
- centeredSquarePyramidal
- centeredPentagonalPyramidal
- centeredHexagonalPyramidal
- centeredHeptagonalPyramidal
- centeredOctagonalPyramidal
- centeredNonagonalPyramidal
- centeredDecagonalPyramidal
- centeredHendecagonalPyramidal
- centeredDodecagonalPyramidal
- centeredTridecagonalPyramidal
- centeredTetradecagonalPyramidal
- centeredPentadecagonalPyramidal
- centeredHexadecagonalPyramidal
- centeredHeptadecagonalPyramidal
- centeredOctadecagonalPyramidal
- centeredNonadecagonalPyramidal
- centeredIcosagonalPyramidal
- centeredIcosihenagonalPyramidal
- centeredIcosidigonalPyramidal
- centeredIcositrigonalPyramidal
- centeredIcositetragonalPyramidal
- centeredIcosipentagonalPyramidal
- centeredIcosihexagonalPyramidal
- centeredIcosiheptagonalPyramidal
- centeredIcosioctagonalPyramidal
- centeredIcosinonagonalPyramidal
- centeredTriacontagonalPyramidal
- triangularPrism
- squarePrism
- pentagonalPrism
- hexagonalPrism
- heptagonalPrism
- octagonalPrism
- nonagonalPrism
- decagonalPrism
- hendecagonalPrism
- dodecagonalPrism
- tridecagonalPrism
- tetradecagonalPrism
- pentadecagonalPrism
- hexadecagonalPrism
- heptadecagonalPrism
- octadecagonalPrism
- nonadecagonalPrism
- icosagonalPrism
- icosihenagonalPrism
- icosidigonalPrism
- icositrigonalPrism
- icositetragonalPrism
- icosipentagonalPrism
- icosihexagonalPrism
- icosiheptagonalPrism
- icosioctagonalPrism
- icosinonagonalPrism
- triacontagonalPrism
- hyperTetrahedral
- hyperCubic
- hyperOctahedral
- hyperDodecahedral
- hyperIcosahedral
- polyOctahedral
- kDimensionalHyperTetrahedron
- kDimensionalHyperCube
- kDimensionalHyperOctahedron
- kDimensionalMgonalPyramidal
- fiveDimensionalMgonalPyramidal
- fourDimensionalMgonalPyramidal
- sixDimensionalMgonalPyramidal
- centeredHyperTetrahedron
- kDimensionalCenteredHyperTetrahedron
- centeredHyperCube
- kDimensionalCenteredHyperCube
- centeredHyperOctahedral
- kDimensionalCenteredHyperOctahedron
- nexus
- pentatope
- biquadratic
- tesseract
- 5-cell
- 8-cell
- 16-cell
- 120-cell
- 600-cell
- 24-cell
- pentachoron
- octachoron
- hexadecachoron
- hecatonicosachoron
- hexacosichoron
- icositetrachoron
- 5-simplex
- 6-simplex
- 7-simplex
- 8-simplex
- 9-simplex
- 10-simplex
- 11-simplex
- 12-simplex
- 13-simplex
- 14-simplex
- 15-simplex
- 16-simplex
- 17-simplex
- 18-simplex
- 19-simplex
- 20-simplex
- 21-simplex
- 22-simplex
- 23-simplex
- 24-simplex
- 25-simplex
- 26-simplex
- 27-simplex
- 28-simplex
- 29-simplex
- 30-simplex
- 5-hypercube
- 6-hypercube
- 7-hypercube
- 8-hypercube
- 9-hypercube
- 10-hypercube
- 11-hypercube
- 12-hypercube
- 13-hypercube
- 14-hypercube
- 15-hypercube
- 16-hypercube
- 17-hypercube
- 18-hypercube
- 19-hypercube
- 20-hypercube
- 21-hypercube
- 22-hypercube
- 23-hypercube
- 24-hypercube
- 25-hypercube
- 26-hypercube
- 27-hypercube
- 28-hypercube
- 29-hypercube
- 30-hypercube
- 5-cross-polytope
- 6-cross-polytope
- 7-cross-polytope
- 8-cross-polytope
- 9-cross-polytope
- 10-cross-polytope
- 11-cross-polytope
- 12-cross-polytope
- 13-cross-polytope
- 14-cross-polytope
- 15-cross-polytope
- 16-cross-polytope
- 17-cross-polytope
- 18-cross-polytope
- 19-cross-polytope
- 20-cross-polytope
- 21-cross-polytope
- 22-cross-polytope
- 23-cross-polytope
- 24-cross-polytope
- 25-cross-polytope
- 26-cross-polytope
- 27-cross-polytope
- 28-cross-polytope
- 29-cross-polytope
- 30-cross-polytope
- 5-centered-hypertetrahedron
- 6-centered-hypertetrahedron
- 7-centered-hypertetrahedron
- 8-centered-hypertetrahedron
- 9-centered-hypertetrahedron
- 10-centered-hypertetrahedron
- 11-centered-hypertetrahedron
- 12-centered-hypertetrahedron
- 13-centered-hypertetrahedron
- 14-centered-hypertetrahedron
- 15-centered-hypertetrahedron
- 16-centered-hypertetrahedron
- 17-centered-hypertetrahedron
- 18-centered-hypertetrahedron
- 19-centered-hypertetrahedron
- 20-centered-hypertetrahedron
- 21-centered-hypertetrahedron
- 22-centered-hypertetrahedron
- 23-centered-hypertetrahedron
- 24-centered-hypertetrahedron
- 25-centered-hypertetrahedron
- 26-centered-hypertetrahedron
- 27-centered-hypertetrahedron
- 28-centered-hypertetrahedron
- 29-centered-hypertetrahedron
- 30-centered-hypertetrahedron
- 5-centered-hypercube
- 6-centered-hypercube
- 7-centered-hypercube
- 8-centered-hypercube
- 9-centered-hypercube
- 10-centered-hypercube
- 11-centered-hypercube
- 12-centered-hypercube
- 13-centered-hypercube
- 14-centered-hypercube
- 15-centered-hypercube
- 16-centered-hypercube
- 17-centered-hypercube
- 18-centered-hypercube
- 19-centered-hypercube
- 20-centered-hypercube
- 21-centered-hypercube
- 22-centered-hypercube
- 23-centered-hypercube
- 24-centered-hypercube
- 25-centered-hypercube
- 26-centered-hypercube
- 27-centered-hypercube
- 28-centered-hypercube
- 29-centered-hypercube
- 30-centered-hypercube
- 5-centered-hyperoctahedron
- 6-centered-hyperoctahedron
- 7-centered-hyperoctahedron
- 8-centered-hyperoctahedron
- 9-centered-hyperoctahedron
- 10-centered-hyperoctahedron
- 11-centered-hyperoctahedron
- 12-centered-hyperoctahedron
- 13-centered-hyperoctahedron
- 14-centered-hyperoctahedron
- 15-centered-hyperoctahedron
- 16-centered-hyperoctahedron
- 17-centered-hyperoctahedron
- 18-centered-hyperoctahedron
- 19-centered-hyperoctahedron
- 20-centered-hyperoctahedron
- 21-centered-hyperoctahedron
- 22-centered-hyperoctahedron
- 23-centered-hyperoctahedron
- 24-centered-hyperoctahedron
- 25-centered-hyperoctahedron
- 26-centered-hyperoctahedron
- 27-centered-hyperoctahedron
- 28-centered-hyperoctahedron
- 29-centered-hyperoctahedron
- 30-centered-hyperoctahedron
Fignumbers is currently under development, and we warmly invite your contributions. Just fork the project and then submit a pull request:
- Sequences from Chapters 1, 2, and 3 of the book
- New sequences not included in the book: If you have new sequences, please provide the source.
- Tests, documentation and errata in the book
When making commits, please use the following conventional prefixes to indicate the nature of the changes: feat
, refactor
, fix
, docs
, and test
.