Math::N...Numbers(3)
๐ NAME ๐
Math::NumSeq::WoodallNumbers โ bestie, it's literally the Woodall numbers, aka i*2^i-1, and yes she's iconic ๐
This page lives in the User Contributed Perl Documentation section, section 3 of the manual, and we're about to have the cutest little math moment together ๐ง
โจ SYNOPSIS โจ
okay so first things first, you load her up and she starts feeding you numbers:
use Math::NumSeq::WoodallNumbers;
my $seq = Math::NumSeq::WoodallNumbers->new;
my ($i, $value) = $seq->next;
that's it. that's the whole vibe. ๐ฆ
๐ธ DESCRIPTION ๐ธ
The Woodall numbers are i*2^i-1, and the sequence starts from i=1, no cap:
1, 7, 23, 63, 159, 383, 895, 2047, 4607, 10239, ...
look at them go ๐ญ she's serving numbers fr fr.
๐ FUNCTIONS ๐
see "FUNCTIONS" in Math::NumSeq for the behaviour common to all sequence classes โ that's the group chat everybody's in ๐
"$seq = Math::NumSeq::WoodallNumbers->new ()"โ creates and returns a brand new sequence object. new bestie, who dis ๐
๐ฆ Iterating ๐ฆ
"$seq->seek_to_i($i)"โ moves the current sequence position to$i. the very next call tonext()will hand you back$iand its corresponding value. it's giving teleportation โจ
๐ Random Access ๐
"$value = $seq->ith($i)"โ returns"$i * 2**$i - 1". that's the formula, she said what she said."$bool = $seq->pred($value)"โ returns true if$valueis a Woodall number, ie. if it's equal toi*2^i-1for somei. vibe check: passed or not ๐"$i = $seq->value_to_i_floor($value)"โ returns the indexiof$value, or the index of the next Woodall number below$value. floor queen ๐"$i = $seq->value_to_i_estimate($value)"โ returns an estimate of theicorresponding to$value. not exact, just a guess, and honestly same ๐ญ
๐งฎ FORMULAS ๐งฎ
โญ Value to i Estimate โญ
An easy over-estimate is l=log2(value), which reverses value=2^l. It can be reduced by the bit length of that l as i=l-log2(l) to get closer. math ate that fr fr ๐ฅ
๐ซถ SEE ALSO ๐ซถ
Math::NumSeqMath::NumSeq::CullenNumbersMath::NumSeq::ProthNumbers
the whole friend group ๐
๐ 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/>.
not the "no warranty" part bestie, that one's serious โ if it breaks, it breaks, and nobody's coming to fix it for you ๐
and that's the whole page, periodt ๐ this was perl v5.42.0, dated 2025-07-25, and she's still out here being Math::N...Numbers(3) like the icon she is ๐
โจ stay slaying, bestie ๐
๐ฆ 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