Math::NumSeq::Odd(3)
π Math::NumSeq::Odd
okay bestie, so this is the manual page for Math::NumSeq::Odd from the User Contributed Perl Documentation section (section 3, the library-calls one, iykyk) π
β¨ NAME β¨
Math::NumSeq::Odd β odd integers π
like. the odd ones. 1, 3, 5. not the even ones. we don't do those here (that's a different module, see SEE ALSO below, no spoilers π«Ά)
πΈ SYNOPSIS πΈ
use Math::NumSeq::Odd;
my $seq = Math::NumSeq::Odd->new;
my ($i, $value) = $seq->next;
that's literally it. three lines and you're off. iconic behaviour tbh β
π¦ DESCRIPTION π¦
The odd integers, bestie:
1, 3, 5, 7, 9, 11, ...
starting i=0
so i=0 gives you 1, i=1 gives you 3, and so on forever. it's giving "infinite" and honestly? obsessed π
π FUNCTIONS π
for the stuff that every single sequence class does the same way, go read "FUNCTIONS" in Math::NumSeq. that's the shared lore. π
$seq = Math::NumSeq::Odd->new ()β makes you a brand new sequence object and hands it back to you. fresh out the box, no cap.
π₯ Iterating
$seq->seek_to_i($i)β moves where you are in the sequence over to$i. the very next time you callnext()it's gonna hand you$iand the value that goes with it. main character energy, you decide where the story starts β¨$seq->seek_to_value($value)β nudges the currentiaround so thatnext()spits out$valuewhen you call it. but β and this is the lil plot twist π β if$valuehappens to be an even integer, then you get the next higher even one instead. not a bug, just the vibe.
π Random Access
$value = $seq->ith($i)β returns2*$i + 1. that's the whole trick. multiply by two, add one, boom, odd number π$bool = $seq->pred($value)β returns true if$valueis odd. that's it. that's the predicate. no notes.$i = $seq->value_to_i_ceil($value)$i = $seq->value_to_i_floor($value)
both of these return (value-1)/2, except one rounds up and one rounds down to the next integer. ceil goes up, floor goes down. you got this π§
$i = $seq->value_to_i_estimate($value)β gives you an estimate of theithat corresponds to$value. it's an estimate, bestie, not a promise π
π SEE ALSO π
Math::NumSeqMath::NumSeq::EvenMath::NumSeq::All
(the whole friend group π«Ά)
π HOME PAGE π
<http://user42.tuxfamily.org/math-numseq/index.html>
go say hi β¨
π LICENSE π
Copyright 2010, 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/>.
ok so real talk: that "WITHOUT ANY WARRANTY" bit is not a joke, bestie β no promises, no guarantees, use it at your own risk π and if you didn't get your copy of the GPL with the module, go grab it at <http://www.gnu.org/licenses/>. periodt.
and that's the whole page, babe π perl v5.42.0, dated 2025-07-25, page Math::NumSeq::Odd(3) β slay, stan, and go count some odd 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