-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to
oeis2
library and reinstate OEIS support (#427)
Closes #367.
- Loading branch information
Showing
11 changed files
with
66 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ then go through each of the available standard libraries. | |
prop-lib | ||
string-lib | ||
prim-lib | ||
oeis-lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
oeis | ||
==== | ||
|
||
Disco provides a library for interfacing with the `Online Encyclopedia | ||
of Integer Sequences <OEIS_>`_ (OEIS). You can :doc:`import | ||
<import>` it with: | ||
|
||
.. _OEIS: https://oeis.org/ | ||
|
||
:: | ||
|
||
import oeis | ||
|
||
The library provides two functions: | ||
|
||
* The ``lookupSequence`` function takes a list of natural numbers and | ||
returns the URL of the first result in the OEIS. For example: | ||
|
||
:: | ||
|
||
Disco> lookupSequence [1,1,2,3,5,8] | ||
right("https://oeis.org/A000045") | ||
|
||
In this example, the returned URL is in fact the OEIS page for the | ||
`Fibonacci numbers <fib_>`_. | ||
|
||
* The ``extendSequence`` function tries to *extend* the given list as | ||
far as it can, using data from the first match on the OEIS. Using | ||
the same example as before, just by putting in the first few | ||
Fibonacci numbers we can get a lot more: | ||
|
||
:: | ||
|
||
Disco> extendSequence [1,1,2,3,5,8] | ||
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169, 63245986, 102334155] | ||
|
||
.. _fib: https://oeis.org/A000045 |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.