Kevin Ryde > Math-NumSeq > Math::NumSeq::DuffinianNumbers

Math-NumSeq-72.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

 Open 0
View/Report Bugs
Module Version: 72

NAME

Math::NumSeq::DuffinianNumbers -- no common factor with sum of divisors

SYNOPSIS

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

DESCRIPTION

This is the Duffinian numbers which are composites having no common factor with their sum of divisors.

```    4, 8, 9, 16, 21, 25, 27, 32, 35, 36, 39, 49, 50, 55, 57, 63, ...
starting i=1```

For example 21 has divisors 1,3,7,21 total 32 which has no common factor with 21. Only composites are included since primes would not be particularly interesting for this rule. They'd having only divisors 1,p and so p+1 never having a common factor with p.

FUNCTIONS

See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.

`\$seq = Math::NumSeq::DuffinianNumbers->new ()`

Create and return a new sequence object.

`\$bool = \$seq->pred(\$value)`

Return true if `\$value` is a Duffinian number.

In the current code a hard limit of 2**32 is placed on the `\$value` to be checked, in the interests of not going into a near-infinite loop. The return is `undef` for bigger values.

Math::NumSeq

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