29
4
The On-Line Encyclopedia of Integer Sequences (OEIS) is an online database of integer sequences. It contains nearly 280000 sequences of mathematical interest.
Examples of sequences:
Your task is to write a program or function that displays as many OEIS sequences as you can, with a source code of 100 bytes maximum. Your program should accept as input the sequence id (without the prepending A
and the zeroes), and output the 20 first numbers in that sequence.
You are not allowed to fetch the data directly from the OEIS website; all sequences must be computed by your code.
Scoring
Score is the number of OEIS sequences the program can display. Answers will have to list the IDs of the sequences recognised by their program.
Example
Here's a valid answer in Java 8:
(int a) -> {
for (int i = 0; i < 20; i++) {
System.out.println(a==27?i+1:i*i);
}
};
This program can display the positive integers (A000027 - input 27) and the squares (A000290 - input 290), thus its score is 2.
Note
Please avoid scraping the whole OEIS website :-) you can download the sequence names (about 3 megs) or sequence values (about 9 megs). Note that this download is covered by the OEIS End-User License Agreement.
Can we write it so that it takes the leading 0's? – TrojanByAccident – 2017-01-18T02:31:07.623
2WHOO! A challenge on OEIS! – JungHwan Min – 2017-01-18T02:34:07.323
1@TrojanByAccident if your idea is to connect to OEIS, that's not allowed on PPCG – Nathan Merrill – 2017-01-18T02:36:26.727
@NathanMerrill I wasn't sure if that counted in this instance – TrojanByAccident – 2017-01-18T02:38:24.087
Are functions allowed? – xnor – 2017-01-18T02:41:09.103
@xnor that's ok – Arnaud – 2017-01-18T02:42:50.937
http://codegolf.stackexchange.com/a/105891/59376 is this allowed lol? – Magic Octopus Urn – 2017-01-18T14:41:18.910
@carusocomputing Given that the language in question doesn't exist, no. – Mego – 2017-01-20T22:09:02.947