/oeis-autoload

Use OEIS sequences as functions in computer programs.

Primary LanguagePerlThe UnlicenseUnlicense

oeis-autoload

OEIS autoload is a Sidef command-line tool and a library that implements support for using OEIS sequences as functions.

Usage example:

$ sidef oeis.sf 'A060881(n)' 0 9    # display first 10 terms of A060881

Several other usage examples:

$ sidef oeis.sf 'A033676(n)^2 + A033677(n)^2'              # first 10 terms
$ sidef oeis.sf 'A033676(n)^2 + A033677(n)^2' 5            # 5-th term
$ sidef oeis.sf 'A033676(n)^2 + A033677(n)^2' 5 20         # terms 5..20

The ID of a OEIS sequence can be called like any other function:

$ sidef oeis.sf 'sum(1..n, {|k| A000330(k) })'
$ sidef oeis.sf 'sum(0..n, {|k| A048994(n, k) * A048993(n+k, n) })'

The OEIS.sm library can also be used inside Sidef scripts, by placing it in the same directory with the script:

include OEIS
say map(1..10, {|k| A000330(k) })