math::figurate(3tcl)
๐ NAME ๐
math::figurate โ Evaluate figurate numbers
ok so real quick, this page lives in the Tcl Math Library and it's manual section 3tcl. That's the whole vibe check up top. Now let's get into it bestie ๐
โจ SYNOPSIS โจ
package require Tcl 8.6 9
package require math::figurate 1.0
::math::figurate::sum_sequence n
::math::figurate::sum_squares n
::math::figurate::sum_cubes n
::math::figurate::sum_4th_power n
::math::figurate::sum_5th_power n
::math::figurate::sum_6th_power n
::math::figurate::sum_7th_power n
::math::figurate::sum_8th_power n
::math::figurate::sum_9th_power n
::math::figurate::sum_10th_power n
::math::figurate::sum_sequence_odd n
::math::figurate::sum_squares_odd n
::math::figurate::sum_cubes_odd n
::math::figurate::sum_4th_power_odd n
::math::figurate::sum_5th_power_odd n
::math::figurate::sum_6th_power_odd n
::math::figurate::sum_7th_power_odd n
::math::figurate::sum_8th_power_odd n
::math::figurate::sum_9th_power_odd n
::math::figurate::sum_10th_power_odd n
::math::figurate::oblong n
::math::figurate::pronic n
::math::figurate::triangular n
::math::figurate::square n
::math::figurate::cubic n
::math::figurate::biquadratic n
::math::figurate::centeredTriangular n
::math::figurate::centeredSquare n
::math::figurate::centeredPentagonal n
::math::figurate::centeredHexagonal n
::math::figurate::centeredCube n
::math::figurate::decagonal n
::math::figurate::heptagonal n
::math::figurate::hexagonal n
::math::figurate::octagonal n
::math::figurate::octahedral n
::math::figurate::pentagonal n
::math::figurate::squarePyramidral n
::math::figurate::tetrahedral n
::math::figurate::pentatope n
๐ธ DESCRIPTION ๐ธ
ok so figurate numbers are literally just sums of numbers that follow a particular pattern. That's it, that's the whole thing. The classic example? Adding up integers 1, 2, ... all the way to n. Because you can arrange 1, 1+2=3, 1+2+3=6, ... little objects into a triangle shape, they got the name triangular numbers. Look at this lil guy:
*
* *
* * *
* * * *
...
it's giving geometry, it's giving pattern recognition, we love to see it ๐
The math::figurate package is a whole collection of procedures that evaluate a wide variety of figurate numbers. Every single formula in here is straightforward, ngl, but the details? sometimes absolutely puzzling ๐ญ.
โ ๏ธ Important note bestie, don't skip this one: the procedures treat arguments lower than zero as meaning "no objects to be counted" and therefore return 0. Periodt.
๐งฎ PROCEDURES ๐งฎ
The procedures sort themselves into a few lil categories: sums of integers raised to a particular power, sums of odd integers, and general figurate numbers โ for instance the pentagonal numbers. Slay. Here's every single one:
๐ซ ::math::figurate::sum_sequence n
Return the sum of integers 1, 2, ..., n.
intn โ Highest integer in the sum
๐ซ ::math::figurate::sum_squares n
Return the sum of squares 1**2, 2**2, ..., n**2.
intn โ Highest base integer in the sum
๐ซ ::math::figurate::sum_cubes n
Return the sum of cubes 1**3, 2**3, ..., n**3.
intn โ Highest base integer in the sum
๐ซ ::math::figurate::sum_4th_power n
Return the sum of 4th powers 1**4, 2**4, ..., n**4.
intn โ Highest base integer in the sum
๐ซ ::math::figurate::sum_5th_power n
Return the sum of 5th powers 1**5, 2**5, ..., n**5.
intn โ Highest base integer in the sum
๐ซ ::math::figurate::sum_6th_power n
Return the sum of 6th powers 1**6, 2**6, ..., n**6.
intn โ Highest base integer in the sum
๐ซ ::math::figurate::sum_7th_power n
Return the sum of 7th powers 1**7, 2**7, ..., n**7.
intn โ Highest base integer in the sum
๐ซ ::math::figurate::sum_8th_power n
Return the sum of 8th powers 1**8, 2**8, ..., n**8.
intn โ Highest base integer in the sum
๐ซ ::math::figurate::sum_9th_power n
Return the sum of 9th powers 1**9, 2**9, ..., n**9.
intn โ Highest base integer in the sum
๐ซ ::math::figurate::sum_10th_power n
Return the sum of 10th powers 1**10, 2**10, ..., n**10.
intn โ Highest base integer in the sum
๐ ::math::figurate::sum_sequence_odd n
Return the sum of odd integers 1, 3, ..., 2n-1
intn โ Highest integer in the sum
๐ ::math::figurate::sum_squares_odd n
Return the sum of odd squares 1**2, 3**2, ..., (2n-1)**2.
intn โ Highest base integer in the sum
๐ ::math::figurate::sum_cubes_odd n
Return the sum of odd cubes 1**3, 3**3, ..., (2n-1)**3.
intn โ Highest base integer in the sum
๐ ::math::figurate::sum_4th_power_odd n
Return the sum of odd 4th powers 1**4, 2**4, ..., (2n-1)**4.
intn โ Highest base integer in the sum
๐ ::math::figurate::sum_5th_power_odd n
Return the sum of odd 5th powers 1**5, 2**5, ..., (2n-1)**5.
intn โ Highest base integer in the sum
๐ ::math::figurate::sum_6th_power_odd n
Return the sum of odd 6th powers 1**6, 2**6, ..., (2n-1)**6.
intn โ Highest base integer in the sum
๐ ::math::figurate::sum_7th_power_odd n
Return the sum of odd 7th powers 1**7, 2**7, ..., (2n-1)**7.
intn โ Highest base integer in the sum
๐ ::math::figurate::sum_8th_power_odd n
Return the sum of odd 8th powers 1**8, 2**8, ..., (2n-1)**8.
intn โ Highest base integer in the sum
๐ ::math::figurate::sum_9th_power_odd n
Return the sum of odd 9th powers 1**9, 2**9, ..., (2n-1)**9.
intn โ Highest base integer in the sum
๐ ::math::figurate::sum_10th_power_odd n
Return the sum of odd 10th powers 1**10, 2**10, ..., (2n-1)**10.
intn โ Highest base integer in the sum
๐ฆ ::math::figurate::oblong n
Return the *n*th oblong number (twice the *n*th triangular number)
intn โ Required index
๐ฆ ::math::figurate::pronic n
Return the *n*th pronic number (synonym for oblong)
intn โ Required index
๐ฆ ::math::figurate::triangular n
Return the *n*th triangular number
intn โ Required index
๐ฆ ::math::figurate::square n
Return the *n*th square number
intn โ Required index
๐ฆ ::math::figurate::cubic n
Return the *n*th cubic number
intn โ Required index
๐ฆ ::math::figurate::biquadratic n
Return the *n*th biquaratic number (i.e. n**4)
intn โ Required index
๐ ::math::figurate::centeredTriangular n
Return the *n*th centered triangular number (items arranged in concentric squares)
intn โ Required index
๐ ::math::figurate::centeredSquare n
Return the *n*th centered square number (items arranged in concentric squares)
intn โ Required index
๐ ::math::figurate::centeredPentagonal n
Return the *n*th centered pentagonal number (items arranged in concentric pentagons)
intn โ Required index
๐ ::math::figurate::centeredHexagonal n
Return the *n*th centered hexagonal number (items arranged in concentric hexagons)
intn โ Required index
๐ ::math::figurate::centeredCube n
Return the *n*th centered cube number (items arranged in concentric cubes)
intn โ Required index
๐ฅ ::math::figurate::decagonal n
Return the *n*th decagonal number (items arranged in decagons with one common vertex)
intn โ Required index
๐ฅ ::math::figurate::heptagonal n
Return the *n*th heptagonal number (items arranged in heptagons with one common vertex)
intn โ Required index
๐ฅ ::math::figurate::hexagonal n
Return the *n*th hexagonal number (items arranged in hexagons with one common vertex)
intn โ Required index
๐ฅ ::math::figurate::octagonal n
Return the *n*th octagonal number (items arranged in octagons with one common vertex)
intn โ Required index
โญ ::math::figurate::octahedral n
Return the *n*th octahedral number (items arranged in octahedrons with a common centre)
intn โ Required index
โญ ::math::figurate::pentagonal n
Return the *n*th pentagonal number (items arranged in pentagons with one common vertex)
intn โ Required index
โญ ::math::figurate::squarePyramidral n
Return the *n*th square pyramidral number (items arranged in a square pyramid)
intn โ Required index
โญ ::math::figurate::tetrahedral n
Return the *n*th tetrahedral number (items arranged in a triangular pyramid)
intn โ Required index
๐ ::math::figurate::pentatope n
Return the *n*th pentatope number (items arranged in the four-dimensional analogue of a triangular pyramid)
intn โ Required index
๐ญ BUGS, IDEAS, FEEDBACK ๐ญ
ok so bestie, let's be real: this document, and the package it describes, will undoubtedly contain bugs and other problems. That's just how it is, no cap. Please report them in the category math :: figurate of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist].
Also please report any ideas for enhancements you may have for either the package and/or the documentation. We love a glow-up suggestion โจ
When proposing code changes, please provide unified diffs, i.e. the output of diff -u.
๐ Heads up: attachments are strongly preferred over inlined patches. You can make an attachment by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.
๐ KEYWORDS ๐
figurate numbers, mathematics
๐ CATEGORY ๐
Mathematics
and that's the whole page bestie, you ate that ๐ โจ
This was tcllib version 1.1, page math::figurate(3tcl) โ go forth and count your lil objects, ily, bye ๐ซถ๐ธ๐
๐ฆ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 ยท Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 ยท Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 ยท Tcl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms