Math::N...gNumbers(3)
π Math::NumSeq::UndulatingNumbers π
okay so bestie, welcome to the User Contributed Perl Documentation corner of the manual, where the page is literally called Math::N...gNumbers(3) because your terminal ran out of room and just β¨truncatedβ¨ it. she's giving mysterious, she's giving you'll never guess the full name, and yet here we are π
β¨ NAME β¨
Math::NumSeq::UndulatingNumbers β numbers with alternating digits, ABABAB...
πΈ SYNOPSIS πΈ
use Math::NumSeq::UndulatingNumbers;
my $seq = Math::NumSeq::UndulatingNumbers->new (radix => 10);
my ($i, $value) = $seq->next;
π¦ DESCRIPTION π¦
okay so this is the sequence of numbers whose digits go ABABAB..., just vibing back and forth between two values. the way that they alternate, it's giving metronome, it's giving heartbeat π
0 ... 99,
101, 111, 121, 131, ... 191,
202, 212, 222, 232, ... 292,
...
909, 919, 929, 939, ... 999,
1010, 1111, 1212, ... 1919,
...
and here's the cute part: numbers with just 1 or 2 digits are A or AB, and those count as undulating form too. so literally every number up to 99 is undulating. they all ate, no crumbs π
the default is decimal, but if you want a different vibe you can pass radix => $r and pick another radix, your choice bestie π
now, in binary there are only two digits, 0 and 1, and the high digit has to be 1, so it ends up being just 101... and 111...:
0, 1, 10, 11, 101, 111, 1010, 1111, 10101, 11111, ...
(in binary)
iconic honestly π
π FUNCTIONS π
lowkey check out "FUNCTIONS" in Math::NumSeq for all the behaviour that's common to every sequence class, because this page is only covering the extra-special stuff π«Ά
$seq = Math::NumSeq::UndulatingNumbers->new ()$seq = Math::NumSeq::UndulatingNumbers->new (radix => $r)
β create and return a brand new sequence object. the default radix is 10, no cap π§
$bool = $seq->pred($value)
β returns true if $value is an undulating number, aka it has digits of the form ABABAB.... yes queen, tell me who you are π
$i = $seq->value_to_i_floor($value)$i = $seq->value_to_i_estimate($value)
β returns the i for the undulating number that is <= $value.
π SEE ALSO π
Math::NumSeq
π HOME PAGE π
<http://user42.tuxfamily.org/math-numseq/index.html>
π 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/>.
β οΈ and like, fr fr β no warranty bestie. don't come for her if it doesn't work out, the license literally said so π
and that's the whole page, you're all caught up π
this was page Math::N...gNumbers(3) (still truncated, still slaying), coming to you from perl v5.42.0, dated 2025-07-25 β mwah, love you, bye πβ¨π
π¦ 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