Math::N...ulative(3)

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

🌸 NAME 🌸

okay so bestie, welcome to Math::NumSeq::SelfLengthCumulative β€” it's giving "cumulative digit length of own values" πŸ’… and yes it's a Perl module, a user contributed one at that, living in the Perl documentation section, and honestly? iconic.


✨ SYNOPSIS ✨

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

like, that's the whole vibe. you use it, you build it, you pull values out one by one. no cap. πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

so what this sequence actually is: it's the cumulative digit length of the values coming out of the sequence itself. self-referential main character energy, fr fr. πŸ”₯

1, 2, 3, 4, ... 9, 10, 12, 14, 16, ... 98, 100, 103, 106, ...

let me break down the way that works, because it's lowkey so cute:

  • value 9 is 1 digit, so you add 1 and get 10 πŸŽ€
  • then 10 is 2 digits, so you add 2 and get 12
  • etc, etc, etc. it just keeps going like that πŸ’«

by default it's decimal digits, but there's an optional "radix" parameter and it can do any other base you want. like, for example "radix => 2" gives you binary:

1, 2, 4, 7, 10, 14, 18, 23, 28, 33, 39, 45, ...

the effect in all cases is to step by 1s up to 10, then by 2s up to 100, then 3s up to 1000, etc, in whatever "radix" you picked. so it's similar to DigitLengthCumulative, except its lengths are from i whereas here they're from the values. subtle but important, bestie 🧚


🫢 FUNCTIONS 🫢

for the behaviour common to all sequence classes, go look at "FUNCTIONS" in Math::NumSeq. that's the shared lore, iykyk.

  • $seq = Math::NumSeq::SelfLengthCumulative->new ()
  • $seq = Math::NumSeq::SelfLengthCumulative->new (radix => $r, to_radix => $t)

create and return a new sequence object. brand new sequence, freshly built, slay πŸ‘‘

  • $bool = $seq->pred($value)

returns true if $value occurs in the sequence. a little yes/no vibe check on whether your number is part of the club πŸ’…


🌈 SEE ALSO 🌈

  • Math::NumSeq
  • Math::NumSeq::DigitLength
  • Math::NumSeq::DigitLengthCumulative

🏠 HOME PAGE 🏠

<http://user42.tuxfamily.org/math-numseq/index.html>


πŸ“œ LICENSE πŸ“œ

Copyright 2012, 2013, 2014, 2016, 2017, 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. (yes bestie, that's the legal equivalent of "no promises, we tried" 😭)

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 that's the whole page, periodt. πŸ’œ

this lil doc was rendered by perl v5.42.0, dated 2025-07-25, sitting under the name Math::N...ulative(3) β€” the truncated little header bestie, it got cut off but we still love her πŸŽ€βœ¨

πŸ“¦ where this page comes from