math::figurate(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– math::figurate β€” the glow-up manual πŸ’–

okay so bestie, this is a page from the Tcl Math Library, manual section n, and it's all about math::figurate β€” the little package that counts figurate numbers for you so you never have to do it by hand like some kind of Victorian. let's get into it πŸ¦‹


✨ NAME ✨

math::figurate β€” Evaluate figurate numbers. that's the whole vibe. numbers that make shapes. slay.


🌸 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

like… look at her. forty-something procedures and every single one is your friend. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so. figurate numbers are literally just sums of numbers that follow a particular pattern. that's it, that's the concept. no cap. πŸ’–

the classic example? the sum of integers 1, 2, ... up to n. and the reason they're called triangular numbers is that you can arrange 1, 1+2=3, 1+2+3=6, ... objects in a lil triangle. like:

      *
      *  *
      *  *  *
      *  *  *  *
      ...

it's giving geometry. it's giving aesthetic. it's giving math. πŸŽ€

the math::figurate package is a whole collection of procedures that evaluate a wide variety of figurate numbers. and listen β€” while all the formulae are straightforward, the details are sometimes puzzling. that's just how it is. πŸ™ˆ

⚠️ note, bestie: the procedures consider arguments lower than zero as meaning "no objects to be counted" and therefore return 0. so negative n = zero, not chaos. she's chill like that.

πŸ¦‹ PROCEDURES πŸ¦‹

these procedures come in a few categories: sums of integers raised to a particular power, sums of odd integers, and general figurate numbers β€” like the pentagonal numbers, for instance. let's go category by category, icon by icon. ✨

πŸ“ sums of powers (the regular ones)

  • ::math::figurate::sum_sequence n β€” Return the sum of integers 1, 2, ..., n.
    • int n β€” Highest integer in the sum
  • ::math::figurate::sum_squares n β€” Return the sum of squares 1**2, 2**2, ..., n**2.
    • int n β€” Highest base integer in the sum
  • ::math::figurate::sum_cubes n β€” Return the sum of cubes 1**3, 2**3, ..., n**3.
    • int n β€” Highest base integer in the sum
  • ::math::figurate::sum_4th_power n β€” Return the sum of 4th powers 1**4, 2**4, ..., n**4.
    • int n β€” Highest base integer in the sum
  • ::math::figurate::sum_5th_power n β€” Return the sum of 5th powers 1**5, 2**5, ..., n**5.
    • int n β€” Highest base integer in the sum
  • ::math::figurate::sum_6th_power n β€” Return the sum of 6th powers 1**6, 2**6, ..., n**6.
    • int n β€” Highest base integer in the sum
  • ::math::figurate::sum_7th_power n β€” Return the sum of 7th powers 1**7, 2**7, ..., n**7.
    • int n β€” Highest base integer in the sum
  • ::math::figurate::sum_8th_power n β€” Return the sum of 8th powers 1**8, 2**8, ..., n**8.
    • int n β€” Highest base integer in the sum
  • ::math::figurate::sum_9th_power n β€” Return the sum of 9th powers 1**9, 2**9, ..., n**9.
    • int n β€” Highest base integer in the sum
  • ::math::figurate::sum_10th_power n β€” Return the sum of 10th powers 1**10, 2**10, ..., n**10.
    • int n β€” Highest base integer in the sum

🌈 sums of odd powers (yes, the odd ones, she's different)

  • ::math::figurate::sum_sequence_odd n β€” Return the sum of odd integers 1, 3, ..., 2n-1
    • int n β€” Highest integer in the sum
  • ::math::figurate::sum_squares_odd n β€” Return the sum of odd squares 1**2, 3**2, ..., (2n-1)**2.
    • int n β€” 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.
    • int n β€” 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.
    • int n β€” 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.
    • int n β€” 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.
    • int n β€” 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.
    • int n β€” 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.
    • int n β€” 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.
    • int n β€” 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.
    • int n β€” Highest base integer in the sum

🧚 the figurate girlies (shapes, but make it numbers)

  • ::math::figurate::oblong n β€” Return the nth oblong number (twice the nth triangular number)
    • int n β€” Required index
  • ::math::figurate::pronic n β€” Return the nth pronic number (synonym for oblong)
    • int n β€” Required index
  • ::math::figurate::triangular n β€” Return the nth triangular number
    • int n β€” Required index
  • ::math::figurate::square n β€” Return the nth square number
    • int n β€” Required index
  • ::math::figurate::cubic n β€” Return the nth cubic number
    • int n β€” Required index
  • ::math::figurate::biquadratic n β€” Return the nth biquaratic number (i.e. n**4)
    • int n β€” Required index
  • ::math::figurate::centeredTriangular n β€” Return the nth centered triangular number (items arranged in concentric squares)
    • int n β€” Required index
  • ::math::figurate::centeredSquare n β€” Return the nth centered square number (items arranged in concentric squares)
    • int n β€” Required index
  • ::math::figurate::centeredPentagonal n β€” Return the nth centered pentagonal number (items arranged in concentric pentagons)
    • int n β€” Required index
  • ::math::figurate::centeredHexagonal n β€” Return the nth centered hexagonal number (items arranged in concentric hexagons)
    • int n β€” Required index
  • ::math::figurate::centeredCube n β€” Return the nth centered cube number (items arranged in concentric cubes)
    • int n β€” Required index
  • ::math::figurate::decagonal n β€” Return the nth decagonal number (items arranged in decagons with one common vertex)
    • int n β€” Required index
  • ::math::figurate::heptagonal n β€” Return the nth heptagonal number (items arranged in heptagons with one common vertex)
    • int n β€” Required index
  • ::math::figurate::hexagonal n β€” Return the nth hexagonal number (items arranged in hexagons with one common vertex)
    • int n β€” Required index
  • ::math::figurate::octagonal n β€” Return the nth octagonal number (items arranged in octagons with one common vertex)
    • int n β€” Required index
  • ::math::figurate::octahedral n β€” Return the nth octahedral number (items arranged in octahedrons with a common centre)
    • int n β€” Required index
  • ::math::figurate::pentagonal n β€” Return the nth pentagonal number (items arranged in pentagons with one common vertex)
    • int n β€” Required index
  • ::math::figurate::squarePyramidral n β€” Return the nth square pyramidral number (items arranged in a square pyramid)
    • int n β€” Required index
  • ::math::figurate::tetrahedral n β€” Return the nth tetrahedral number (items arranged in a triangular pyramid)
    • int n β€” Required index
  • ::math::figurate::pentatope n β€” Return the nth pentatope number (items arranged in the four-dimensional analogue of a triangular pyramid)
    • int n β€” Required index
🫢 not a single one skipped, bestie. every index-having icon made it to the list. periodt.

😭 BUGS, IDEAS, FEEDBACK 😭

ngl, this document and the package it describes will undoubtedly contain bugs and other problems. that's just the reality of software, we don't gatekeep that. πŸ™ˆ

please report such 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. she wants your thoughts. she's listening. πŸ’œ

when proposing code changes, please provide unified diffs, i.e. the output of diff -u.

πŸ“Ž note further that attachments are strongly preferred over inlined patches. attachments can be made 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. okay? okay. πŸ’…

πŸ‘‘ KEYWORDS πŸ‘‘

figurate numbers, mathematics


⭐ CATEGORY ⭐

Mathematics


and that's the whole page, bestie!! πŸŽ€βœ¨ this little manual ships with tcllib, version 1.1, and it's filed under math::figurate(n). go count some triangles, you absolute main character. πŸ’–πŸ¦‹πŸ’…

πŸ“¦ where this page comes from