Math::NumSeq::Abundant -- abundant numbers, greater than sum of divisors
use Math::NumSeq::Abundant; my $seq = Math::NumSeq::Abundant->new; my ($i, $value) = $seq->next;
The abundant numbers, being integers greater than the sum of their divisors,
12, 18, 20, 24, 30, 36, ...
For example 12 is abundant because its divisors 1,2,3,4,6 add up to 16 which is > 12.
This is often expressed as 2*n>sigma(n) where sigma(n) is the sum of divisors including n itself.
abundant_type parameter can select some variations,
"abundant" n > sum divisors (the default) "deficient" n < sum divisors "primitive" abundant and not a multiple of an abundant
If a number N is abundant then so are multiples 2*N, 3*N, etc. The "primitive" abundants are those which are not such a multiple of a smaller abundant.
Numbers with n == sum divisors are the perfect numbers 6, 28, 496, 8128, 33550336, etc. There's nothing here for them currently. They're quite sparse, with Euler proving the even ones are n=2^(k-1)*(2^k-1) for prime 2^k-1. And the existence of any odd perfect numbers is a famous unsolved problem -- if there are any then they're very big.
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::Abundant->new ()
$seq = Math::NumSeq::Abundant->new (abundant_type => $str)
Create and return a new sequence object.
$bool = $seq->pred($value)
Return true if
$valueis abundant, deficient or primitive abundant per
This check requires factorizing
$valueand in the current code a hard limit of 2**32 is placed on values to be checked, in the interests of not going into a near-infinite loop.
Copyright 2010, 2011, 2012, 2013 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/>.