[Haskell-cafe] ANN: Math.OEIS 0.1

Brent Yorgey byorgey at gmail.com
Mon Oct 22 07:20:47 EDT 2007

Hi all,

I'm pleased to announce the release of a somewhat silly -- yet perhaps
somewhat useful -- library module,
intended for the enjoyment of combinatorial dilettantes, Project Euler
addicts, and the merely curious alike.  It provides a Haskell interface to
the Online Encyclopedia of Integer Sequences, with support for looking up
sequences by ID number or partial list.  You can use it to look up any and
all information on a sequence (references, formulas, comments, keywords...),
or just return the sequence data as a list.  My favorite feature -- and the
initial impetus for the library -- is that it can "guess" the rest of a
sequence by using the first search result from the OEIS to extend it.  Some
examples of use:

Prelude Math.OEIS> extendSequence [5,7,11,13,17]

Prelude Math.OEIS> extendSequence [2,4,8,16,32]

Prelude Math.OEIS> description `fmap` lookupSequence [1,2,5,14,42]
Just "Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!). Also
called Segner numbers."

Math.OEIS can be obtained from
and additional documentation is included with the module in Haddock form.

Features planned for future versions include:
* support for returning multiple search results instead of just one.
* support for automatically returning additional terms if available in a
b****.txt file.
* hack GHC to provide [1,2,5,14,42..] syntax for extendSequence.
* returning a lazy infinite list for infinite sequences via an embedded
general AI and Mathematica interpreter.

-Brent (byorgey)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071022/da6c5eb8/attachment.htm

More information about the Haskell-Cafe mailing list