The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Math::NumSeq::Perrin -- Perrin sequence

SYNOPSIS

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

DESCRIPTION

The Perrin sequence,

    3, 0, 2, 3, 2, 5, 5, 7, 10, 12, 17, 22, 29, 39, 51, etc

which is the recurrance

    P(i) = P(i-2) + P(i-3)

starting from 3,0,2. So for example 29 is 12+17.

    12, 17, 22, 29
     |   |       |
     +---+-------+

FUNCTIONS

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

$seq = Math::NumSeq::Perrin->new (length => $integer)

Create and return a new sequence object.

$value = $seq->ith($i)

Return the $i'th value from the sequence.

SEE ALSO

Math::NumSeq, Math::NumSeq::Fibonacci