
On Mon, 22 Oct 2007, Brent Yorgey wrote:
Hi all,
I'm pleased to announce the release of a somewhat silly -- yet perhaps somewhat useful -- library module, Math.OEIShttp://hackage.haskell.org/cgi-bin/hackage-scripts/package/oeis-0.1, 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] [5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71...
Cute!
Prelude Math.OEIS> extendSequence [2,4,8,16,32] [2,4,8,16,32,64,128,256,512,1024,2048,4096,8192...
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."
The Online Encyclopedia of Integer Sequences should really contain more Haskell code for describing the sequences.