Skip to main content

A complete generator of infinite sequences of figurate numbers

Project description

FigurateNum

FigurateNum is a set of figurate number generators based on the book Figurate Numbers (2012) by Michel Deza and Elena Deza.

FigurateNum generates the following types of infinite sequences:

  • 20 sequences of plane figurate numbers
  • 38 sequences of space figurate numbers
  • 18 sequences of multidimensional figurate numbers

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 endeavors. 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
  • It is advisable to use a virtual environment.

How to import figuratenum?

import figuratenum as fgn

How to use?

>>> seq = fgn.hyperdodecahedral_numbers()

>>> first = next(seq)
>>> second = next(seq)
>>> third = next(seq)
>>> fourth = next(seq)

>>> print(first, second, third, fourth)
1 600 4983 19468

You could get a list of numbers using a loop:

>>> generator = fgn.k_dimensional_centered_hypertetrahedron_numbers(21)
>>> sequence = []
>>> for _ in range(1, 15):
>>>     next_num = next(generator)
>>>     sequence.append(next_num)

>>> print(sequence)
[1, 23, 276, 2300, 14950, 80730, 376740, 1560780, 5852925, 20160075, 64512240, 193536720, 548354040, 1476337800]

Equivalently, using the array module:

import array as arr_num

>>> generator = fgn.aztec_diamond_numbers()
>>> sequence = arr_num.array('i')
>>> for _ in range(1, 15):
>>>     next_num = next(generator)
>>>     sequence.append(next_num)

>>> print(sequence)
array('i', [4, 12, 24, 40, 60, 84, 112, 144, 180, 220, 264, 312, 364, 420])

Plane figurate numbers

  1. polygonal_numbers
  2. triangular_numbers
  3. triangular_numbers
  4. square_numbers
  5. pentagonal_numbers
  6. hexagonal_numbers
  7. heptagonal_numbers
  8. octagonal_numbers
  9. nonagonal_numbers
  10. decagonal_numbers
  11. hendecagonal_numbers
  12. dodecagonal_numbers
  13. tridecagonal_numbers
  14. tetradecagonal_numbers
  15. pentadecagonal_numbers
  16. hexadecagonal_numbers
  17. heptadecagonal_numbers
  18. octadecagonal_numbers
  19. nonadecagonal_numbers
  20. icosagonal_numbers
  21. icosihenagonal_numbers
  22. icosidigonal_numbers
  23. icositrigonal_numbers
  24. icositetragonal_numbers
  25. icosipentagonal_numbers
  26. icosihexagonal_numbers
  27. icosiheptagonal_numbers
  28. icosioctagonal_numbers
  29. icosinonagonal_numbers
  30. triacontagonal_numbers
  31. centered_triangular_numbers
  32. centered_square_numbers = diamond numbers
  33. centered_pentagonal_numbers
  34. centered_hexagonal_numbers
  35. centered_heptagonal_numbers
  36. centered_octagonal_numbers
  37. centered_nonagonal_numbers
  38. centered_decagonal_numbers
  39. centered_hendecagonal_numbers
  40. centered_dodecagonal_numbers = star_numbers
  41. centered_tridecagonal_numbers
  42. centered_tetradecagonal_numbers
  43. centered_pentadecagonal_numbers
  44. centered_hexadecagonal_numbers
  45. centered_heptadecagonal_numbers
  46. centered_octadecagonal_numbers
  47. centered_nonadecagonal_numbers
  48. centered_icosagonal_numbers
  49. centered_icosihenagonal_numbers
  50. centered_icosidigonal_numbers
  51. centered_icositrigonal_numbers
  52. centered_icositetragonal_numbers
  53. centered_icosipentagonal_numbers
  54. centered_icosihexagonal_numbers
  55. centered_icosiheptagonal_numbers
  56. centered_icosioctagonal_numbers
  57. centered_icosinonagonal_numbers
  58. centered_triacontagonal_numbers
  59. centered_mgonal_numbers
  60. pronic_numbers = heteromecic_numbers = oblong_numbers
  61. polite_numbers
  62. impolite_numbers
  63. cross_numbers
  64. aztec_diamond_numbers
  65. polygram_numbers(m) = centered_star_polygonal_numbers(m)
  66. pentagram_numbers
  67. gnomic_numbers
  68. truncated_triangular_numbers
  69. truncated_square_numbers
  70. truncated_pronic_numbers
  71. truncated_centered_pol_numbers(m) = truncated_centered_pol_numbers(m)
  72. truncated_centered_hexagonal_numbers = truncated_hex_numbers
  73. generalized_mgonal_numbers(m, start_numb)
  74. generalized_centered_pol_numbers(m, start_numb)
  75. generalized_pronic_numbers(start_numb)

Space figurate numbers

  1. m_pyramidal_numbers(m)
  2. cubic_numbers
  3. tetrahedral_numbers
  4. octahedral_numbers
  5. dodecahedral_numbers
  6. icosahedral_numbers
  7. truncated_tetrahedral_numbers
  8. truncated_cubic_numbers
  9. truncated_octahedral_numbers
  10. stella_octangula_numbers
  11. centered_cube_numbers
  12. rhombic_dodecahedral_numbers
  13. hauy_rhombic_dodecahedral_numbers
  14. centered_tetrahedron_numbers = centered_tetrahedral_numbers
  15. centered_square_pyramid_numbers = centered_pyramid_numbers
  16. centered_mgonal_pyramid_numbers(m)
  17. centered_octahedron_numbers
  18. centered_icosahedron_numbers = centered_cuboctahedron_numbers
  19. centered_dodecahedron_numbers
  20. centered_truncated_tetrahedron_numbers
  21. centered_truncated_cube_numbers
  22. centered_truncated_octahedron_numbers
  23. centered_mgonal_pyramidal_numbers(m)
  24. centered_hexagonal_pyramidal_numbers = hex_pyramidal_numbers
  25. hexagonal_prism_numbers
  26. mgonal_prism_numbers(m)
  27. generalized_mgonal_pyramidal_numbers(m, start_num)
  28. generalized_cubic_numbers(start_num)
  29. generalized_octahedral_numbers(start_num)
  30. generalized_icosahedral_numbers(start_num)
  31. generalized_dodecahedral_numbers(start_num)
  32. generalized_centered_cube_numbers(start_num)
  33. generalized_centered_tetrahedron_numbers(start_num)
  34. generalized_centered_square_pyramid_numbers(start_num)
  35. generalized_rhombic_dodecahedral_numbers(start_num)
  36. generalized_centered_mgonal_pyramidal_numbers(m, start_num)
  37. generalized_mgonal_prism_numbers(m, start_num)
  38. generalized_hexagonal_prism_numbers(start_num)

Multidimensional figurate numbers

  1. pentatope_numbers = hypertetrahedral_numbers = triangulotriangular_numbers
  2. k_dimensional_hypertetrahedron_numbers(k) = k_hypertetrahedron_numbers(k) = regular_k_polytopic_numbers(k) = figurate_numbers_of_order_k(k)
  3. biquadratic_numbers
  4. k_dimensional_hypercube_numbers(k) = k_hypercube_numbers(k)
  5. hyperoctahedral_numbers = hexadecachoron_numbers = four_cross_polytope_numbers = four_orthoplex_numbers
  6. hypericosahedral_numbers = tetraplex_numbers = polytetrahedron_numbers = hexacosichoron_numbers
  7. hyperdodecahedral_numbers = hecatonicosachoron_numbers = dodecaplex_numbers = polydodecahedron_numbers
  8. polyoctahedral_numbers = icositetrachoron_numbers = octaplex_numbers = hyperdiamond_numbers
  9. k_dimensional_hyperoctahedron_numbers(k) = k_cross_polytope_numbers(k)
  10. four_dimensional_mgonal_pyramidal_numbers(m) = mgonal_pyramidal_numbers_of_the_second_order
  11. k_dimensional_mgonal_pyramidal_numbers(k, m) = mgonal_pyramidal_numbers_of_the_k_2_th_order(k, m)
  12. centered_biquadratic_numbers
  13. k_dimensional_centered_hypercube_numbers(k)
  14. centered_polytope_numbers
  15. k_dimensional_centered_hypertetrahedron_numbers(k)
  16. centered_hyperoctahedral_numbers = orthoplex_numbers
  17. nexus_numbers
  18. k_dimensional_centered_hyperoctahedron_numbers(k)

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.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

figuratenum-0.5.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

figuratenum-0.5.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file figuratenum-0.5.0.tar.gz.

File metadata

  • Download URL: figuratenum-0.5.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for figuratenum-0.5.0.tar.gz
Algorithm Hash digest
SHA256 f149cf7f59e6df90e03cc1edb642243f8a459fbd82b6eff4474f35c3326cfdba
MD5 1d63c5a310f4d99833d8edf13e9faa35
BLAKE2b-256 ca775c3c22902075903d00a38dd7f0bbfcfd06c3a37326b09a7b1b96e164f6e5

See more details on using hashes here.

File details

Details for the file figuratenum-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: figuratenum-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for figuratenum-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b72b0c96bf4e6949cdd7c6bf3147690e848114b2250556facec9bdefbd8bec89
MD5 783024b763508b1129efb80474daa9c8
BLAKE2b-256 be2482f44e44b0e4ad64ee86ecdd6013653466fe996d322baeb5864394c9dae7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page