1Math::NumSeq::DigitProdUuscetr(3C)ontributed Perl DocumeMnattaht:i:oNnumSeq::DigitProduct(3)
2
3
4
6 Math::NumSeq::DigitProduct -- product of digits
7
9 use Math::NumSeq::DigitProduct;
10 my $seq = Math::NumSeq::DigitProduct->new (radix => 10);
11 my ($i, $value) = $seq->next;
12
14 The products of the digits of i, for example at i=456 the value is
15 4*5*6=120. i=0 is treated as a single digit 0, so it's product is 0.
16
17 For binary ("radix => 2") the digits are all just 0 or 1 which means
18 the product is 1 for numbers 0b1, 0b11, 0b111, etc, 2**k-1, or 0
19 otherwise.
20
22 See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
23 classes.
24
25 "$seq = Math::NumSeq::DigitProduct->new ()"
26 "$seq = Math::NumSeq::DigitProduct->new (radix => $r)"
27 Create and return a new sequence object. The default radix is 10,
28 ie. decimal, or a "radix" parameter can be given.
29
30 Random Access
31 "$value = $seq->ith($i)"
32 Return the product of the digits of $i.
33
34 "$bool = $seq->pred($value)"
35 Return true if $value is the product of some set of digits. This
36 means its factors (prime factors) are all less than the radix,
37 since nothing bigger can occur.
38
40 Math::NumSeq, Math::NumSeq::DigitLength, Math::NumSeq::DigitSum
41
43 <http://user42.tuxfamily.org/math-numseq/index.html>
44
46 Copyright 2011, 2012, 2013, 2014 Kevin Ryde
47
48 Math-NumSeq is free software; you can redistribute it and/or modify it
49 under the terms of the GNU General Public License as published by the
50 Free Software Foundation; either version 3, or (at your option) any
51 later version.
52
53 Math-NumSeq is distributed in the hope that it will be useful, but
54 WITHOUT ANY WARRANTY; without even the implied warranty of
55 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
56 General Public License for more details.
57
58 You should have received a copy of the GNU General Public License along
59 with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
60
61
62
63perl v5.28.1 2014-06-29 Math::NumSeq::DigitProduct(3)