1Math::NumSeq::DigitSum(U3s)er Contributed Perl DocumentatMiaotnh::NumSeq::DigitSum(3)
2
3
4
6 Math::NumSeq::DigitSum -- sum of digits, possibly with powering
7
9 use Math::NumSeq::DigitSum;
10 my $seq = Math::NumSeq::DigitSum->new (radix => 10);
11 my ($i, $value) = $seq->next;
12
14 The sum of digits in each i, so 0,1,...,9,1,2,..., etc. For example at
15 i=123 the value is 1+2+3=6.
16
18 See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
19 classes.
20
21 "$seq = Math::NumSeq::DigitSum->new ()"
22 "$seq = Math::NumSeq::DigitSum->new (radix => $r, power => $p)"
23 Create and return a new sequence object. The default is decimal,
24 with no powering, or "radix" and/or "power" parameters can be
25 given.
26
27 Random Access
28 "$value = $seq->ith($i)"
29 Return the sum of the digits of $i, each raised to the given
30 "power" parameter.
31
32 "$bool = $seq->pred($value)"
33 Return true if $value occurs as a sum of digits, which means simply
34 "$value >= 0".
35
37 Math::NumSeq, Math::NumSeq::DigitLength, Math::NumSeq::DigitProduct,
38 Math::NumSeq::DigitSumModulo
39
41 <http://user42.tuxfamily.org/math-numseq/index.html>
42
44 Copyright 2011, 2012, 2013, 2014, 2016, 2019 Kevin Ryde
45
46 Math-NumSeq is free software; you can redistribute it and/or modify it
47 under the terms of the GNU General Public License as published by the
48 Free Software Foundation; either version 3, or (at your option) any
49 later version.
50
51 Math-NumSeq is distributed in the hope that it will be useful, but
52 WITHOUT ANY WARRANTY; without even the implied warranty of
53 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54 General Public License for more details.
55
56 You should have received a copy of the GNU General Public License along
57 with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
58
59
60
61perl v5.34.0 2021-07-22 Math::NumSeq::DigitSum(3)