Kevin Ryde > Math-NumSeq-64 > Math::NumSeq::Abundant

Math-NumSeq-64.tar.gz

Dependencies

Annotate this POD

Website

# CPAN RT

 Open 1
View/Report Bugs
Module Version: 64   Source   Latest Release: Math-NumSeq-67

# NAME

Math::NumSeq::Abundant -- abundant numbers, greater than sum of divisors

# SYNOPSIS

use Math::NumSeq::Abundant;
my \$seq = Math::NumSeq::Abundant->new;
my (\$i, \$value) = \$seq->next;

# DESCRIPTION

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.

The optional 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.

## Perfect Numbers

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.

# FUNCTIONS

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 \$value is abundant, deficient or primitive abundant per \$seq.

This check requires factorizing \$value and 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.

Math::NumSeq

http://user42.tuxfamily.org/math-numseq/index.html