Function Repository Resource:

OEISSequenceData

Source Notebook

Access sequences and metadata from The Online Encyclopedia of Integer Sequences

Contributed by: Jesse Friedman

ResourceFunction["OEISSequenceData"][id]

gives the beginning of the sequence with the given ID.

ResourceFunction["OEISSequenceData"][id,property]

gives the value of the specified property for the sequence with the given ID.

ResourceFunction["OEISSequenceData"][{id1,id2,}]

gives the beginning of each of the sequences with the given IDs.

ResourceFunction["OEISSequenceData"][{id1,id2,},property]

gives the value of the specified property for each of the sequences with the given IDs.

Details and Options

In ResourceFunction["OEISSequenceData"][id,], id can be either an integer or an OEIS "A-number" like "A123456".
The following properties can be used in ResourceFunction["OEISSequenceData"][id,property]:
"IDNumber"the sequence's OEIS ID number as an integer
"IDString"the sequence's OEIS "A-number" as a string
"FormerIDStrings"a list of any other forms of ID strings the sequence may have had in previous publications
"Sequence"the beginning of the sequence, as a list of integers
"Name"the name of the sequence
"Comments"a list of any notes or comments on the sequence
"References"a list of references for the sequence
"Links"a list of links related to the sequence
"LinksHTML"a list of links related to the sequence, as raw HTML
"Formulae"a list of formulae for the sequence
"Example"a list of examples to illustrate the initial terms of the sequence
"CodeMaple"code in Maple to produce the sequence
"CodeWolframLanguage"code in the Wolfram Language to produce the sequence, as held expressions
"CodeWolframLanguageStrings"code in the Wolfram Language to produce the sequence, as the original strings
"CodeOther"code in other programming languages to produce the sequence
"CrossreferenceLines"a list of crossreferences to related sequences
"CrossreferenceIDNumbers"a list of crossreferences to related sequences, by the ID number of each as an integer
"ReferenceCount"the number of sequences that reference this sequence
"Keywords"a list of keywords describing the sequence
"Offset"the subscript of the first term in the sequence, or the number of digits before the decimal point if the sequence gives the decimal expansion of a constant
"Author"the person or persons who contributed the sequence
"Extensions"information about edits, extensions, or error corrections to the sequence
"Revision"the revision number of this version of the sequence
"DateCreated"the date that the sequence was first contributed
"DateModified"the date that the sequence was last modified
"Dataset"a Dataset of all properties of the sequence

Examples

Basic Examples (2) 

Get the beginning of sequence A269160:

In[1]:=
ResourceFunction["OEISSequenceData"][269160]
Out[1]=

Get a Dataset of all properties of the sequence:

In[2]:=
ResourceFunction["OEISSequenceData"][269160, "Dataset"]
Out[2]=

Scope (2) 

Get the name of sequence A004100:

In[3]:=
ResourceFunction["OEISSequenceData"][4100, "Name"]
Out[3]=

Get the name of the same sequence by specifying its full "A-number" string:

In[4]:=
ResourceFunction["OEISSequenceData"]["A004100", "Name"]
Out[4]=

Applications (4) 

Plot the initial terms of a sequence:

In[5]:=
ListLinePlot[ResourceFunction["OEISSequenceData"][269160]]
Out[5]=

Get Wolfram Language code that will produce the sequence:

In[6]:=
wlCode = ResourceFunction["OEISSequenceData"][269160, "CodeWolframLanguage"]
Out[6]=

The code is wrapped in HoldComplete for security; release the hold so it is evaluated:

In[7]:=
wlSequence = ReleaseHold[wlCode]
Out[7]=

Plot these newly-calculated terms:

In[8]:=
ListLinePlot[wlSequence]
Out[8]=

Properties and Relations (2) 

ResourceFunction["OEISSequence"]["id"] is equivalent to OEISSequenceData["id"]:

In[9]:=
ResourceFunction["OEISSequence"]["A004100"] === ResourceFunction["OEISSequenceData"]["A004100"]
Out[9]=

The resource function OEISSequence may be significantly faster for some records with large amounts of metadata, as it only has to retrieve and parse the sequence itself:

In[10]:=
AssociationMap[
 First@AbsoluteTiming[#["A000045"]] &, {ResourceFunction[
   "OEISSequence"], ResourceFunction["OEISSequenceData"]}]
Out[10]=

Possible Issues (1) 

The "CodeOther" property gives all code in a single string:

In[11]:=
ResourceFunction["OEISSequenceData"][720, "CodeOther"]
Out[11]=

Neat Examples (2) 

Get the names of all the sequences cross-referenced by a sequence:

In[12]:=
names = ResourceFunction["OEISSequenceData"][#, "Name"] & /@ ResourceFunction["OEISSequenceData"][796, "CrossreferenceIDNumbers"];

Make a word cloud from the names:

In[13]:=
WordCloud[DeleteStopwords@Flatten@TextWords@names]
Out[13]=

Publisher

Jesse Friedman

Version History

  • 1.0.0 – 03 October 2019

Related Resources

License Information