Generate 233 infinite figurate number sequences for mathematical research, applications, and exploration in Python.
Project description
FigurateNum
FigurateNum is a collection of 233 figurate number generators based on the book Figurate Numbers by Michel Deza and Elena Deza, published in 2012.
What is the purpose of FigurateNum?
FigurateNum facilitates the discovery of new patterns among sequences and enables various numerical calculations in mathematical projects and related applications. It can be integrated with other software to visualize the geometric objects described. Moreover, it serves as a valuable companion to the book.
How to install?
pip install figuratenum
🚨 Version 2.0.0 includes renamed methods and changes in class usage. These changes are incompatible with previous versions. Please review the updated usage instructions below to adapt your code to the new structure.
Features
FigurateNum generates the following categories of infinite sequences:
- 79 sequences of plane figurate numbers Explore all sequences
- 86 sequences of space figurate numbers Explore all sequences
- 68 sequences of multidimensional figurate numbers Explore all sequences
During the development of this package, errata were identified in Figurate Numbers (2012). The corresponding corrections are available here.
How to use?
1. Import all sequences via the FigurateNum class
from figuratenum import FigurateNum as fgn
>>> seq = fgn()
>>> hyperdodecahedral = seq.hyperdodecahedral()
>>> first = next(hyperdodecahedral)
>>> second = next(hyperdodecahedral)
>>> third = next(hyperdodecahedral)
>>> fourth = next(hyperdodecahedral)
>>> print(first, second, third, fourth)
1 600 4983 19468
2.Import sequences through specialized classes: Plane, Space, and Multidimensional
# from figuratenum import PlaneFigurateNum as pfgn
# from figuratenum import SpacedimensionalFigurateNum as sfgn
from figuratenum import MultidimensionalFigurateNum as mfgn
>>> seq_loop = mfgn()
>>> k_dimensional_centered_hypertetrahedron = seq_loop.k_dimensional_centered_hypertetrahedron(21)
>>> figuratenum_arr = []
>>> for _ in range(1, 15):
>>> next_num = next(k_dimensional_centered_hypertetrahedron)
>>> figuratenum_arr.append(next_num)
>>> print(figuratenum_arr)
[1, 23, 276, 2300, 14950, 80730, 376740, 1560780, 5852925, 20160075, 64512240, 193536720, 548354040, 1476337800]
3. Using the NumCollector class for sequence collection
from figuratenum import NumCollector as nc
Importing the NumCollector class allows you to use practical methods to return lists, tuples or arrays with the requested number of elements:
take(n)take_to_list(stop, start, step)take_to_array(stop, start, step)take_to_tuple(stop, start, step)pick(n)
>>> seq = fgn()
>>> pentatope = seq.pentatope()
>>> print(nc.take_to_list(pentatope, 10))
[1, 5, 15, 35, 70, 126, 210, 330, 495, 715]
Plane figurate numbers
polygonaltriangularsquarepentagonalhexagonalheptagonaloctagonalnonagonaldecagonalhendecagonaldodecagonaltridecagonaltetradecagonalpentadecagonalhexadecagonalheptadecagonaloctadecagonalnonadecagonalicosagonalicosihenagonalicosidigonalicositrigonalicositetragonalicosipentagonalicosihexagonalicosiheptagonalicosioctagonalicosinonagonaltriacontagonalcentered_triangularcentered_square=diamond numberscentered_pentagonalcentered_hexagonalcentered_heptagonalcentered_octagonalcentered_nonagonalcentered_decagonalcentered_hendecagonalcentered_dodecagonal=starcentered_tridecagonalcentered_tetradecagonalcentered_pentadecagonalcentered_hexadecagonalcentered_heptadecagonalcentered_octadecagonalcentered_nonadecagonalcentered_icosagonalcentered_icosihenagonalcentered_icosidigonalcentered_icositrigonalcentered_icositetragonalcentered_icosipentagonalcentered_icosihexagonalcentered_icosiheptagonalcentered_icosioctagonalcentered_icosinonagonalcentered_triacontagonalcentered_mgonal(m)pronic=heteromecic = oblongpoliteimpolitecrossaztec_diamondpolygram(m)=centered_star_polygonal(m)pentagramgnomictruncated_triangulartruncated_squaretruncated_pronictruncated_centered_pol(m)=truncated_centered_mgonal(m)truncated_centered_triangulartruncated_centered_squaretruncated_centered_pentagonaltruncated_centered_hexagonal=truncated_hexgeneralized_mgonal(m, start_numb)generalized_pentagonal(start_numb)generalized_hexagonal(start_numb)generalized_centered_pol(m, start_numb)generalized_pronic(start_numb)
Space figurate numbers
m_pyramidal(m)triangular_pyramidalsquare_pyramidal=pyramidalpentagonal_pyramidalhexagonal_pyramidalheptagonal_pyramidaloctagonal_pyramidalnonagonal_pyramidaldecagonal_pyramidalhendecagonal_pyramidaldodecagonal_pyramidaltridecagonal_pyramidaltetradecagonal_pyramidalpentadecagonal_pyramidalhexadecagonal_pyramidalheptadecagonal_pyramidaloctadecagonal_pyramidalnonadecagonal_pyramidalicosagonal_pyramidalicosihenagonal_pyramidalicosidigonal_pyramidalicositrigonal_pyramidalicositetragonal_pyramidalicosipentagonal_pyramidalicosihexagonal_pyramidalicosiheptagonal_pyramidalicosioctagonal_pyramidalicosinonagonal_pyramidaltriacontagonal_pyramidaltriangular_tetrahedral[finite]triangular_square_pyramidal[finite]square_tetrahedral[finite]square_square_pyramidal[finite]tetrahedral_square_pyramidal[finite]cubictetrahedraloctahedraldodecahedralicosahedraltruncated_tetrahedraltruncated_cubictruncated_octahedralstella_octangulacentered_cuberhombic_dodecahedralhauy_rhombic_dodecahedralcentered_tetrahedron=centered_tetrahedralcentered_square_pyramid=centered_pyramidcentered_mgonal_pyramid(m)centered_pentagonal_pyramidcentered_hexagonal_pyramidcentered_heptagonal_pyramidcentered_octagonal_pyramidcentered_octahedroncentered_icosahedron=centered_cuboctahedroncentered_dodecahedroncentered_truncated_tetrahedroncentered_truncated_cubecentered_truncated_octahedroncentered_mgonal_pyramidal(m)centered_triangular_pyramidalcentered_square_pyramidalcentered_pentagonal_pyramidalcentered_heptagonal_pyramidalcentered_octagonal_pyramidalcentered_nonagonal_pyramidalcentered_decagonal_pyramidalcentered_hendecagonal_pyramidalcentered_dodecagonal_pyramidalcentered_hexagonal_pyramidal=hex_pyramidalhexagonal_prismmgonal_prism(m)generalized_mgonal_pyramidal(m, start_num)generalized_pentagonal_pyramidal(start_num)generalized_hexagonal_pyramidal(start_num)generalized_cubic(start_num)generalized_octahedral(start_num)generalized_icosahedral(start_num)generalized_dodecahedral(start_num)generalized_centered_cube(start_num)generalized_centered_tetrahedron(start_num)generalized_centered_square_pyramid(start_num)generalized_rhombic_dodecahedral(start_num)generalized_centered_mgonal_pyramidal(m, start_num)generalized_mgonal_prism(m, start_num)generalized_hexagonal_prism(start_num)
Multidimensional figurate numbers
pentatope=hypertetrahedral=triangulotriangulark_dimensional_hypertetrahedron(k)=k_hypertetrahedron(k)=regular_k_polytopic(k)=figurate_of_order_k(k)five_dimensional_hypertetrahedronsix_dimensional_hypertetrahedronbiquadratick_dimensional_hypercube(k)=k_hypercube(k)five_dimensional_hypercubesix_dimensional_hypercubehyperoctahedral=hexadecachoron=four_cross_polytope=four_orthoplexhypericosahedral=tetraplex=polytetrahedron=hexacosichoronhyperdodecahedral=hecatonicosachoron=dodecaplex=polydodecahedronpolyoctahedral=icositetrachoron=octaplex=hyperdiamondfour_dimensional_hyperoctahedronfive_dimensional_hyperoctahedronsix_dimensional_hyperoctahedronseven_dimensional_hyperoctahedroneight_dimensional_hyperoctahedronnine_dimensional_hyperoctahedronten_dimensional_hyperoctahedronk_dimensional_hyperoctahedron(k)=k_cross_polytope(k)four_dimensional_mgonal_pyramidal(m)=mgonal_pyramidal_of_the_second_order(m)four_dimensional_square_pyramidalfour_dimensional_pentagonal_pyramidalfour_dimensional_hexagonal_pyramidalfour_dimensional_heptagonal_pyramidalfour_dimensional_octagonal_pyramidalfour_dimensional_nonagonal_pyramidalfour_dimensional_decagonal_pyramidalfour_dimensional_hendecagonal_pyramidalfour_dimensional_dodecagonal_pyramidalk_dimensional_mgonal_pyramidal(k, m)=mgonal_pyramidal_of_the_k_2_th_order(k, m)five_dimensional_mgonal_pyramidal(m)five_dimensional_square_pyramidalfive_dimensional_pentagonal_pyramidalfive_dimensional_hexagonal_pyramidalfive_dimensional_heptagonal_pyramidalfive_dimensional_octagonal_pyramidalsix_dimensional_mgonal_pyramidal(m)six_dimensional_square_pyramidalsix_dimensional_pentagonal_pyramidalsix_dimensional_hexagonal_pyramidalsix_dimensional_heptagonal_pyramidalsix_dimensional_octagonal_pyramidalcentered_biquadratick_dimensional_centered_hypercube(k)five_dimensional_centered_hypercubesix_dimensional_centered_hypercubecentered_polytopek_dimensional_centered_hypertetrahedron(k)five_dimensional_centered_hypertetrahedronsix_dimensional_centered_hypertetrahedroncentered_hyperoctahedral=orthoplexnexus(k)k_dimensional_centered_hyperoctahedron(k)five_dimensional_centered_hyperoctahedronsix_dimensional_centered_hyperoctahedrongeneralized_pentatope(start_num = 0)generalized_k_dimensional_hypertetrahedron(k = 5, start_num = 0)generalized_biquadratic(start_num = 0)generalized_k_dimensional_hypercube(k = 5, start_num = 0)generalized_hyperoctahedral(start_num = 0)generalized_k_dimensional_hyperoctahedron(k = 5, start_num = 0)generalized_hyperdodecahedral(start_num = 0)generalized_hypericosahedral(start_num = 0)generalized_polyoctahedral(start_num = 0)generalized_k_dimensional_mgonal_pyramidal(k, m, start_num = 0)generalized_k_dimensional_centered_hypercube(k, start_num = 0)generalized_nexus(start_num = 0)
Errata for Figurate Numbers (2012)
This section lists the errata and corrections for the book Figurate Numbers (2012) by Michel Deza and Elena Deza. If you find any errors in the content, please feel free to contribute corrections.
-
Chapter 1, formula in the table on page 6 says:
Name Formula Square 1/2 (n^2 - 0 * n)It should be:
Name Formula Square 1/2 (2n^2 - 0 * n) -
Chapter 1, formula in the table on page 51 says:
Name Formula Cent. icosihexagonal 1/3n^2 - 13 * n + 1546, 728, 936, 1170It should be:
Name Formula Cent. icosihexagonal 1/3n^2 - 13 * n + 1547, 729, 937, 1171 -
Chapter 1, formula in the table on page 51 says:
Name Formula Cent. icosiheptagonal 972It should be:
Name Formula Cent. icosiheptagonal 973 -
Chapter 1, formula in the table on page 51 says:
Name Formula Cent. icosioctagonal 84It should be:
Name Formula Cent. icosioctagonal 85 -
Chapter 1, page 65 (polite numbers) says:
inpolite numbersIt should read:
impolite numbers -
Chapter 1, formula (truncated centered pentagonal numbers) on page 72 says:
TCSS_5(n) = (35n^2 - 55n) / 2 + 3It should be:
TCSS_5(n) = (35n^2 - 55n) / 2 + 11 -
Chapter 2, formula of octagonal pyramidal number on page 92 says:
n(n+1)(6n-1) / 6It should be:
n(n+1)(6n-3) / 6 -
Chapter 2, page 140 says:
centered square pyramidal numbers are 1, 6, 19, 44, 85, 111, 146, 231, ...
This sequence must exclude the number 111:
centered square pyramidal numbers are 1, 6, 19, 44, 85,
111, 146, 231, ... -
Chapter 2, page 155 (generalized centered tetrahedron numbers) says:
S_3^3(n) = ((2n - 1)(n^2 + n + 3)) / 3Formula must have a negative sign:
S_3^3(n) = ((2n - 1)(n^2 - n + 3)) / 3 -
Chapter 2, page 156 (generalized centered square pyramid numbers) says:
S_4^3(n) = ((2n - 1) * (n^2 - n + 2)^2) / 3Formula must write:
S_4^3(n) = ((2n - 1) * (n^2 - n + 2)) / 2 -
Chapter 3, page 188 (hyperoctahedral numbers) says:
hexadecahoron numbersIt should read:
hexadecachoron numbers -
Chapter 3, page 190 (hypericosahedral numbers) says:
hexacisihoron numbersIt should read:
hexacosichoron numbers
Contributing
FigurateNumber 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file figuratenum-2.0.0.tar.gz.
File metadata
- Download URL: figuratenum-2.0.0.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ad3ee7331bd4f2c82f85f851551d9dc9a2f3b43597355b585cd4403d3642cc6
|
|
| MD5 |
47731d2abbca89551627c56298559974
|
|
| BLAKE2b-256 |
73a6854e1c3b2adf791ee6776f0b2b37cf39b7a40615d88b92e1a3dcfdf395f8
|
File details
Details for the file figuratenum-2.0.0-py3-none-any.whl.
File metadata
- Download URL: figuratenum-2.0.0-py3-none-any.whl
- Upload date:
- Size: 31.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f6d7423bc61a24c3f6675ba1ec4e09190a45b17fcb713743515ccada059243e
|
|
| MD5 |
3d3f4aecb4226288ff87f23920ba886d
|
|
| BLAKE2b-256 |
88cc61e4433b07f2d92e1bbb2e3f3748d75bbf0438faf4fef62d9b3068224624
|