NAME
Math::NumSeq::DigitSumModulo -- digit sum taken modulo a given modulus
SYNOPSIS
use Math::NumSeq::DigitSumModulo;
my $seq = Math::NumSeq::DigitSumModulo->new (radix => 10,
modulus => 9);
my ($i, $value) = $seq->next;
DESCRIPTION
The sum of digits in each i, taken modulo a given modulus. For example at i=123 with modulus 5 the value is 1+2+3=6, mod 5 = 1.
Modulus 0, which is the default, means modulo the radix.
FUNCTIONS
See "FUNCTIONS" in Math::NumSeq for the behaviour common to all path classes.
$seq = Math::NumSeq::DigitSumModulo->new (radix => $r, modulus => $d)
-
Create and return a new sequence object.
$value = $seq->ith($i)
-
Return the sum of the digits in
$i
written inradix
, modulo themodulus
. $bool = $seq->pred($value)
-
Return true if
$value
might occur as value in the sequence, which means simply$value
= 0> and$value <= modulus
.