Math::NumSeq::SelfLengthCumulative -- cumulative digit length of own values
my $seq = Math::NumSeq::SelfLengthCumulative->new (radix => 10);
my ($i, $value) = $seq->next;
Cumulative digit length of values from the sequence itself,
1, 2, 3, 4, ... 9, 10, 12, 14, 16, ... 98, 100, 103, 106, ...
Value 9 is 1 digit, so add 1 to give 10. Then 10 is 2 digits so add 2 to give 12, etc.
The default is decimal digits, or optional radix parameter can give another base. For example radix => 2 binary
radix => 2
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. This is similar to DigitLengthCumulative, but its lengths are from i whereas here they're from the values.
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::SelfLengthCumulative->new ()
$seq = Math::NumSeq::SelfLengthCumulative->new (radix => $r, to_radix => $t)
Create and return a new sequence object.
$bool = $seq->pred($value)
Return true if $value occurs in the sequence.
Math::NumSeq, Math::NumSeq::DigitLength, Math::NumSeq::DigitLengthCumulative
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.
You should have received a copy of the GNU General Public License along with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
To install Math::NumSeq, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.