Math::N...:Pronic(3)
π Math::NumSeq::Pronic β the manual, but make it cute π
okay so bestie, you found the page for Math::NumSeq::Pronic π
it lives in the User Contributed Perl Documentation corner of the perl universe, and it is literally just about pronic numbers. yes that's a real word. yes it's iconic. let's go π¦
β¨ NAME β¨
Math::NumSeq::Pronic β pronic numbers π
πΈ SYNOPSIS πΈ
use Math::NumSeq::Pronic;
my $seq = Math::NumSeq::Pronic->new;
my ($i, $value) = $seq->next;
that's it. that's the whole vibe check. build the sequence, pull numbers out one at a time, slay β¨
π DESCRIPTION π
so the pronic numbers are the ones you get from i*(i+1). no cap.
0, 2, 6, 12, 20, 30, ...
starting i=0
and here's the tea β these are twice the triangular numbers, and they sit half way between the perfect squares. main character geometry fr fr π
π FUNCTIONS π
for the behaviour that every single sequence class shares, go peek at "FUNCTIONS" in Math::NumSeq. that's the group chat everyone's in π¬
$seq = Math::NumSeq::Pronic->new ()β make a brand new sequence object and hand it back to you. born fresh, zero notes π«Ά
π Iterating
$seq->seek_to_i($i)β move the current sequence position to$i. the next time you callnext(), it'll give you back$iand the matching value. literally just fast-forwarding your playlist to the right track π§$seq->seek_to_value($value)β move the current position so thatnext()hands you$valueon the next call. and if$valueisn't actually a pronic number? no worries, you get the next pronic one above$value. rounding up, always up, we don't do down here π
β Random Access
$value = $seq->ith($i)β returns"$i*($i+1)". cute, simple, does exactly what it says on the tin π$bool = $seq->pred($value)β true if$valueis a pronic number, meaningi*(i+1)for somei. it's the "are you one of us" check π₯$i = $seq->value_to_i_ceil($value)$i = $seq->value_to_i_floor($value)
these two give you the $i index of $value, rounding up or down if $value isn't a pronic number. pick your fighter β¬οΈβ¬οΈ
$i = $seq->value_to_i_estimate($value)β an estimate of theithat goes with$value. the formulavalue=i*(i+1)gets inverted like this:
$i = int( (sqrt(4*$value + 1) - 1)/2 )
math girlies rise πβ¨
π SEE ALSO π
Math::NumSeq, Math::NumSeq::Squares, Math::NumSeq::Triangular π¦
πΈ HOME PAGE πΈ
<http://user42.tuxfamily.org/math-numseq/index.html> β go visit, it's giving cozy π
π LICENSE π
Copyright 2010, 2011, 2012, 2013, 2014, 2016, 2017, 2019, 2020 Kevin Ryde
Math-NumSeq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Math-NumSeq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
β οΈ okay important heads-up bestie: that WITHOUT ANY WARRANTY bit is real and it means real. no promises, no guarantees, not even the implied ones for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. read the license, it's the whole point π₯
and that's the whole page, you ate it, periodt π β¨
this iconic little page shipped with perl v5.42.0 and was dated 2025-07-25 β mwah, bye bestie, go compute some pronic numbers π«Άπ
π¦ where this page comes from
- fedora 43: perl-Math-NumSeq 75-11.fc43 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms