Hi all,<br><br>I'm pleased to announce the release of a somewhat silly -- yet perhaps somewhat useful -- library module, <a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/oeis-0.1">Math.OEIS</a>, 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:
<br><br>Prelude Math.OEIS> extendSequence [5,7,11,13,17]<br>[5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71...<br><br>Prelude Math.OEIS> extendSequence [2,4,8,16,32]<br>[2,4,8,16,32,64,128,256,512,1024,2048,4096,8192...
<br><br>Prelude Math.OEIS> description `fmap` lookupSequence [1,2,5,14,42]<br>Just "Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!). Also called Segner numbers."<br><br>Math.OEIS can be <a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/oeis-0.1">
obtained from hackage</a>, and additional documentation is included with the module in Haddock form. <br><br>Features planned for future versions include:<br>* support for returning multiple search results instead of just one.
<br>* support for automatically returning additional terms if available in a b****.txt file.
<br>* hack GHC to provide [1,2,5,14,42..] syntax for extendSequence.<br>* returning a lazy infinite list for infinite sequences via an embedded general AI and Mathematica interpreter.<br><br>Enjoy!<br>-Brent (byorgey)<br>