Math::N...llDigits(3)

πŸ“¦
version 75 Β· 2 versions
, in fedora 43

πŸ’– Math::NumSeq::AllDigits β€” bestie edition πŸ’–

okay so this is a User Contributed Perl Documentation page for Math::NumSeq::AllDigits, and it's literally just the digits of the integers, one by one, no cap. pull up a chair, we're going through the whole thing together 🫢

✨ NAME ✨

Math::NumSeq::AllDigits β€” digits of the integers πŸ‘‘


🌈 SYNOPSIS 🌈

use Math::NumSeq::AllDigits;
my $seq = Math::NumSeq::AllDigits->new;
my ($i, $value) = $seq->next;

that's it. that's the whole vibe. three lines and you're in πŸŽ€


πŸ’… DESCRIPTION πŸ’…

so the sequence is the digits of the integers 0, 1, 2, etc, and it looks like this:

0,1,2,3,4,5,6,7,8,9, 1,0, 1,1, 1,2, 1,3, 1,4, 1,5, 1,6,...
starting i=0

like yes, it's 0 through 9 first, and then once we hit 10 it starts unspooling into separate digits β€” 1,0 β€” and then 1,1, then 1,2, and it just keeps going forever. it's giving "infinite receipt from CVS" energy 🧾✨

default is decimal, obvi. but the "radix" parameter can pick a whole other base if you're feeling spicy 🌢️

and there's this optional "order" parameter (it's a string, bestie, remember that) that controls the order of the digits inside each integer:

"forward"      high to low, 3512 -> 3,5,1,2
"reverse"      low to high, 3512 -> 2,1,5,3
"sorted"       sorted, 3512 -> 1,2,3,5
  • "forward" β€” high to low, so 3512 becomes 3,5,1,2
  • "reverse" β€” low to high, so 3512 becomes 2,1,5,3
  • "sorted" β€” sorted, so 3512 becomes 1,2,3,5

three options, three moods. pick your fighter πŸ’–


πŸ¦‹ FUNCTIONS πŸ¦‹

also see "FUNCTIONS" in Math::NumSeq for the behaviour that's common to all sequence classes β€” the shared lore, iykyk πŸ“š

  • $seq = Math::NumSeq::Digit->new ()
  • $seq = Math::NumSeq::Digit->new (radix => $radix, order => $str)

create and return a shiny new sequence object ✨ like, congrats, you're a parent now.

πŸŽ€ Random Access πŸŽ€

  • $value = $seq->ith($i) β€” return the $i'th value from the sequence. jump straight to it, no waiting in line πŸ’…
  • $bool = $seq->pred($value) β€” return true if $value occurs in the sequence. and like, that's simply whether it's a digit from 0 to radix-1. nothing deeper than that, fr fr.

πŸ”₯ SEE ALSO πŸ”₯

Math::NumSeq, Math::NumSeq::All

Math::NumSeq::SqrtDigits, Math::NumSeq::DigitLength, Math::NumSeq::Runs, Math::NumSeq::ConcatNumbers

(the friend group πŸ’œ go say hi)


🌸 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/>.

heads up bestie: that "WITHOUT ANY WARRANTY" part is not a vibe, it's a legal fact. no promises, no guarantees, periodt. πŸ™ˆ

and that's the whole page!! this was perl v5.42.0, dated 2025-07-25, and honestly? iconic. slay, stay hydrated, and may your digits always be in order πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from