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

NAME

Math::NumSeq::OEIS -- number sequence by OEIS A-number

SYNOPSIS

 use Math::NumSeq::OEIS;
 my $seq = Math::NumSeq::OEIS->new (anum => 'A000032');
 my ($i, $value) = $seq->next;

DESCRIPTION

This is a sequence from the Online Encyclopedia of Integer Sequences, selected by it's A-number.

If there's NumSeq code implementing the sequence then that's used, otherwise files if available. See Math::NumSeq::OEIS::Catalogue for available A-numbers.

OEIS files are sought in an OEIS directory in the user's home directory. It can use HTML, "internal" format, and B-file or A-file.

    ~/OEIS/A000032.html
    ~/OEIS/A000032.internal
    ~/OEIS/b000032.txt
    ~/OEIS/a000032.txt

    downloaded from:
    http://oeis.org/A000032/
    http://oeis.org/A000032/internal
    http://oeis.org/A000032/b000032.txt
    http://oeis.org/A000032/a000032.txt

The "internal" format is more reliable for parsing than the HTML. The B-file or A-file alone can be used, but in that case there's no $seq->description() and some of the $seq->characteristic() attributes.

The a000000.txt or b000000.txt files are generally a long list of values (the a.txt longer than the b.txt, when available). Some sequences don't have them, only 30 or 40 sample values from HTML or internal page, though they may be enough for fast growing sequences.

Sometimes more than one NumSeq module can generate a given OEIS sequence. For example Polygonal k=4 and the Squares are both A000290. Math::NumSeq::OEIS tries to give the faster or more sensible one.

Sometimes the OEIS has duplicates, ie. two A-numbers which are the same sequence. When there's NumSeq module code implementing the sequence Math::NumSeq::OEIS is accepts either A-number (as long as both have been put in the code).

FUNCTIONS

$seq = Math::NumSeq::OEIS->new (anum => 'A000000')

Create and return a new sequence object.

SEE ALSO

Math::NumSeq, Math::NumSeq::OEIS::Catalogue

HOME PAGE

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

LICENSE

Copyright 2010, 2011 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/>.