The SloaneEncyclopedia object provides access to a local copy of the database containing only the sequences and their names. To use this you must download and install the database using SloaneEncyclopedia.install(), or SloaneEncyclopedia.install_from_gz() if you have already downloaded the database manually.
To look up a sequence, type
sage: SloaneEncyclopedia[60843] # optional - sloane_database
[1, 6, 21, 107]
To get the name of a sequence, type
sage: SloaneEncyclopedia.sequence_name(1) # optional - sloane_database
'Number of groups of order n.'
To search locally for a particular subsequence, type
sage: SloaneEncyclopedia.find([1,2,3,4,5], 1) # optional - sloane_database
[(15, [1, 2, 3, 4, 5, 7, 7, 8, 9, 11, 11, 13, 13, 16, 16, 16, 17, 19, 19, 23, 23, 23, 23, 25, 25, 27, 27, 29, 29, 31, 31, 32, 37, 37, 37, 37, 37, 41, 41, 41, 41, 43, 43, 47, 47, 47, 47, 49, 49, 53, 53, 53, 53, 59, 59, 59, 59, 59, 59, 61, 61, 64, 64, 64, 67, 67, 67, 71, 71, 71, 71, 73])]
The default maximum number of results is 30, but to return up to 100, type
sage: SloaneEncyclopedia.find([1,2,3,4,5], 100) # optional - sloane_database
[(15, [1, 2, 3, 4, 5, 7, 7, 8, 9, 11, 11, ...
Results in either case are of the form [ (number, list) ].
See also
AUTHORS:
A local copy of the Sloane Online Encyclopedia of Integer Sequences that contains only the sequence numbers and the sequences themselves.
Return a list of all sequences which have seq as a subsequence, up to maxresults results. Sequences are returned in the form (number, list).
INPUT:
OUTPUT: list of 2-tuples (i, v), where v is a sequence with seq as a subsequence.
Download and install the online encyclopedia, raising an IOError if either step fails.
INPUT:
Install the online encyclopedia from a local stripped.gz file.
INPUT:
Load the entire encyclopedia into memory from a file. This is done automatically if the user tries to perform a lookup or a search.
Return the name of sequence N in the encyclopedia. If sequence N does not exist, return ‘’. If the names database is not installed, raise an IOError.
INPUT:
OUTPUT: string
EXAMPLES:
sage: SloaneEncyclopedia.sequence_name(1) # optional - sloane_database ‘Number of groups of order n.’
Remove the database from memory.
Decompress a gzipped file and install the bzipped verson. This is used by SloaneEncyclopedia.install_from_gz to install several gzipped OEIS database files.
INPUT:
This internal function was only used by the sloane_find function, which is now deprecated.
This function is broken. It is replaced by the OEIS module.
Type oeis? for more information.
TESTS:
sage: sloane_find([1,2,3])
doctest:1: DeprecationWarning: The function sloane_find is deprecated. Use oeis() instead (2012-01-01).
See http://trac.sagemath.org/10358 for details.
This function is broken. It is replaced by the OEIS module.
Type oeis? for more information.
TESTS:
sage: sloane_sequence(123)
doctest:1: DeprecationWarning: The function sloane_sequence is deprecated. Use oeis() instead (2012-01-01).
See http://trac.sagemath.org/10358 for details.