oeis2: Interface for Online Encyclopedia of Integer Sequences (OEIS).

[ bsd3, library, math ] [ Propose Tags ]

Modules

[Last Documentation]

  • Math
    • Math.OEIS
      • Math.OEIS.Internal
      • Math.OEIS.Types

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7
Dependencies aeson (>=1.1 && <1.6), base (>=4.7 && <5), containers (>=0.5 && <0.7), http-conduit (>=2.2 && <2.4), lens (>=4.15 && <6), lens-aeson (>=1.0 && <2), text (>=1.2 && <1.3), vector (>=0.12 && <0.13) [details]
License BSD-3-Clause
Copyright 2019 Taisuke Hikawa
Author Taisuke Hikawa
Maintainer 23.prime.37@gmail.com
Revised Revision 1 made by sjakobi at 2022-05-20T21:51:01Z
Category Math
Home page https://github.com/23prime/oeis2#readme
Bug tracker https://github.com/23prime/oeis2/issues
Source repo head: git clone https://github.com/23prime/oeis2
Uploaded by 23prime at 2022-03-20T11:41:48Z
Distributions
Downloads 2934 total (21 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2022-03-20 [all 2 reports]

Readme for oeis2-1.0.7

[back to package description]

oeis2

GitHub Actions Haskell Hackage version Stackage version BSD3

Haskell interface for Online Encyclopedia of Integer Sequences; homage to oeis.

Difference from oeis

  • Source data of OEIS.
    : oeis use fmt=text, but this library use fmt=json.
  • Possible to get all search results.
  • Search functions from ID or sub-sequence are merged.
  • Possibele to search from other than ID or sub-sequence.
  • Support for HTTPS.

Usage

Add import statement.

import Math.OEIS
  • Get all search results from sub-sequence

    • If n == 0, you get all search results.

      ghci>searchSeq (SubSeq [1,2,3,4]) 0
      [OEIS {number = "A000027", ids = ["M0472","N0173"], seqData = [1,2,3,4,5,6,7,...
      ghci>length it
      53
      
    • Otherwise, you get first n search results.

      ghci>searchSeq (SubSeq [1,2,3,4]) 17
      [OEIS {number = "A000027", ids = ["M0472","N0173"], seqData = [1,2,3,4,5,6,7,8,9,
      ghci>length it
      17
      
  • Get first few terms from sub-sequence

    ghci>getSeqData (SubSeq [1,2,2,3,3,3,4,4,4,4])
    Just [1,2,2,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,7,...
    
  • Get Mathematica function from sub-sequence

    ghci>mathematica <$> lookupSeq (SubSeq [1,2,2,3,3,3,4,4,4,4])
    Just ["a[1] = 1; a[n_] := a[n] = a[n - a[n - 1]] + 1 (* _Branko Curgus_, May 12 2009 *)","Table[n, {n, 13}, {n}] // Flatten (* _Robert G. Wilson v_, May 11 2010 *)"]
    
  • If no search result

    ghci>lookupSeq (ID "1145141919893")
    Nothing