Math::N...rNumbers(3)
๐ NAME ๐
Math::NumSeq::StarNumbers โ star numbers, aka 6*i*(i-1)+1 ๐ซ (this is the Perl user-contributed docs version, so hi bestie, you're in the right place ๐ซถ)
โจ SYNOPSIS โจ
use Math::NumSeq::StarNumbers;
my $seq = Math::NumSeq::StarNumbers->new;
my ($i, $value) = $seq->next;
like, that's it. three lines and you're pulling star numbers out of thin air. iconic. ๐
๐ DESCRIPTION ๐
Okay so this class gives you the sequence of star numbers โ and they go
1, 13, 37, 73, 121, etc
and the formula behind the whole thing is
6*i*(i-1)+1
they're also known as the centred 12-gonals, because geometry said "what if a polygon but make it a star" and honestly? it ate. โญ
๐ FUNCTIONS ๐
heads up bestie, for all the behaviour that every sequence class shares, go read "FUNCTIONS" in Math::NumSeq. this page is just the star-number-specific lore. ๐ธ
$seq = Math::NumSeq::StarNumbers->new ()โ makes you a brand new sequence object and hands it back to you. fresh out the box, no cap. ๐
๐ฎ Random Access ๐ฎ
$value = $seq->ith($i)โ gimme the value at index$i, and it returns you exactly6*$i*($i-1)+1. literally just that. ๐$bool = $seq->pred($value)โ the vibe check ๐ต๏ธโ๏ธ: returns true if$valuecan be written as6*i*(i-1)+1for somei. if it can't, it's not a star number, sorry babe. ๐$i = $seq->value_to_i_floor($value)$i = $seq->value_to_i_estimate($value)โ these two both return theifor the star number that's<= $value. yes, both of them. they're listed together like that. ๐ซถ
๐ SEE ALSO ๐
- Math::NumSeq
- Math::NumSeq::Polygonal
go read those too, they're the whole extended universe. ๐
๐ HOME PAGE ๐
<http://user42.tuxfamily.org/math-numseq/index.html>
that's the house this whole thing lives in. โจ
๐ 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 that's the whole page, mwah ๐ this was perl v5.42.0, dated 2025-07-25, and the page is Math::NumSeq::StarNumbers(3) โ go forth and compute star numbers, bestie, you got this ๐๐ง
๐ฆ 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