Math::N...nNumbers(3)
π Math::NumSeq::CullenNumbers π
okay bestie, so this is a page from the User Contributed Perl Documentation, and it's all about Math::NumSeq::CullenNumbers β the Cullen numbers, which are genuinely so iconic for no reason. let's get into it π¦
β¨ NAME β¨
Math::NumSeq::CullenNumbers β Cullen numbers i*2^i+1
like. the name is the whole vibe. Cullen numbers. i*2^i+1. that's her. π
πΈ SYNOPSIS πΈ
use Math::NumSeq::CullenNumbers;
my $seq = Math::NumSeq::CullenNumbers->new;
my ($i, $value) = $seq->next;
so you pull in the module, you make a new sequence object, and then you just keep calling ->next and it hands you back a pair of ($i, $value). it's giving "infinite little snack dispenser" fr fr π
π DESCRIPTION π
The Cullen numbers are i*2^i+1, and the sequence starts from i=0, so you get:
1, 3, 9, 25, 65, 161, 385, 897, 2049, 4609, 10241, ...
look at those numbers. they're growing. they're thriving. main character energy honestly β¨
π FUNCTIONS π
heads up bestie: for the behaviour that's common to all the sequence classes, go read "FUNCTIONS" in Math::NumSeq. that's the shared lore. this page is just the Cullen-specific stuff π
$seq = Math::NumSeq::CullenNumbers->new ()β creates a brand new sequence object and hands it back to you. new object, new era, slay.
π₯ Random Access π₯
$value = $seq->ith($i)β returns"$i * 2**$i + 1". you ask for the i-th one, it gives you the i-th one. no notes. π$bool = $seq->pred($value)β returns true if$valueis a Cullen number, ie. it's equal toi*2^i+1for somei. it's basically the vibe check for "are you one of us" π«Ά$i = $seq->value_to_i_estimate($value)β returns an estimate of theithat corresponds to$value. note the word estimate, bestie. it's an estimate. don't come for her. π
π FORMULAS π
β¨ Value to i Estimate β¨
see "Value to i Estimate" in Math::NumSeq::WoodallNumbers. yeah it points at the Woodall page, they're cousins, it's a whole family thing, iykyk π
π SEE ALSO π
Math::NumSeqMath::NumSeq::WoodallNumbers
π¦ HOME PAGE π¦
<http://user42.tuxfamily.org/math-numseq/index.html>
π§ LICENSE π§
Copyright 2011, 2012, 2013, 2014, 2016, 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 so the all-caps parts are doing a LOT of heavy lifting here β no warranty, no merchantability, no fitness for a particular purpose. that's the legal equivalent of "not my problem" and it is very much on purpose. read it, respect it, don't skip it π
and that's the whole page, bestie! π this one's from perl v5.42.0, dated 2025-07-25, and it's filed under Math::NumSeq::CullenNumbers(3) in section 3 of the manual. go forth and enumerate some Cullen numbers, you absolute icon πβ¨
π¦ 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