Skip to content

TheCK/joeis

 
 

Repository files navigation

jOEIS

A collection of pure Java programs implementing sequences from The On-Line Encyclopedia of Integer Sequences (OEIS).

This is likely the largest coherent collection of programs for OEIS sequences beyond the Maple, Mathematica, and Pari programs directly associated with many entries. Currently over 115,000 sequences are implemented.

Installation

Instructions for installation and development: INSTALLATION

Background

The following plot shows how the number of implemented sequences has changed over the years.

history-plot

The following plot shows the number of sequences implemented (in bins of 1000):

done-plot

A similar plot with one pixel for each sequence. Green indicates an implemented sequence. Black indicates to be done, feel free to help.

implemented-plot

Implementations of specific sequences implement the Sequence interface which provides a single method next(). The contract requires this to produce either the next member of the sequence or null in the case of reaching the end of a finite sequence. In addition, it might sometimes throw an UnsupportedOperationException if the computing the next value is beyond the current implementation or if it would exceed the values that can be represented by the big integer class.

There is no direct support for generating the nth term of a sequence and so to generate the nth term, it is necessary to call next() repeatedly until the desired term is reached. Internally this sometimes leads to significant inefficiency (e.g., generating functions being repeatedly expanded to higher and higher degree), but keeps the overall contract as simple as possible.

Implementations are not necessarily the best known algorithm for particular sequences. For many important sequences you are not going to be able to compute new terms using the implementations provided. However, included here are implementations that have been used to compute new previously unknown terms, including some for sequences considered hard.

Related Software

Because Java does not come with libraries supporting all the things we need to do to construct integer sequences, a lot of functionality has been built from the ground up. While a lot of this is implemented specifically for this project, there are important pieces of code which have been re-implemented or ported from other projects.

Although Java has its own BigInteger class for large integers, this project uses a big integer type, Z.java based originally on Lenstra's lip C package.

Most sequences requiring real number arithmetic are handled using classes based on Hans-J. Boehm's constructible real arithmetic. A smaller number of real number based sequences make use of Mikko Tommila's apfloat library.

A large number of linear recurrences, generating functions, and tiling sequences are based on code developed by Georg Fischer.

Certain parts of the nauty package for computing automorphism groups of graphs and digraphs were ported to Java. Included here by permission (see associated copyright). For serious work needing this functionality, I would recommend using the C implementations available from nauty.

Similarly, parts of the plantri package for generating planar graphs were ported to Java. Included here by permission (see associated copyright). Again a canonical implementation is available from plantri.

Certain sequences requiring factorization of large integers are backed by queries to factordb.com.

Certain sequences involving counting positions in chess make use of the Chesspresso library by Bernhard Seybold.

Testing

The individual sequence implementations are tested again the data lines of the corresponding OEIS entries. In order to run the tests, the stripped.gz must first be retrieved from the OEIS server and layed out in a way the tests expect. This is accomplished by test/irvine/oeis/Makefile. In addition to tests for individual sequences, the test suite also covers functionality of shared library code.

Other Acknowledgements

This project has benefited immensely and on numerous occasions by other contributors to the OEIS and members of the seqfan mailing list. This ranges from explanations of sequences, detective work, finding papers, vetting edits resulting from this project.

References

About

Java implementations of sequences in the OEIS

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors