If I were to implement an esolang that uses a cached version of OEIS (one that doesn't fetch from the internet) would it be valid? For instance, if I were to scrape OEIS and grab the mathematical formula, then tie that formula to the integer assigned to the sequence and use that as my esolang, is that valid?
The code would look something like:
Code: 55
Input: 3
Output: 2
Of course it would also have built-ins for array manipulation, simple arithmetic, and you would be able to "chain" sequences as well. I'd consider also including multiple modes for ath term
, first term below a
, first term higher than a
, etc... Would this be non-competing, or would this be a genuinely good language for golfing?
Secondary question I guess, would it be possible to scrap all Mathematica formulas for OEIS entries that exist (http://oeis.org/search?fmt=text&q=1,2,3,6,11,23,47,106,235):
%F A000055 G.f.: A(x) = 1 + T(x) - T^2(x)/2 + T(x^2)/2, where T(x) = x + x^2 + 2*x^3 + ... is the g.f. for A000081.
%F A000055 a(n) = A000081(n) - A217420(n+1), n>0. - _R. J. Mathar_, Sep 19 2016
Then use the mathematica formula to calculate it?
I guess the main question is does anyone have experience with how accurate these formulas are in general?
CURRENT PROGRESS:
I've managed to write a snippet that extracts code from OEIS, visiting the page in text format:
http://oeis.org/search?q=id:A000001&fmt=text
By doing this I've managed to turn each OEIS into a cached format of:
A000001.oeis.txt:
(n-terms):0,1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51,1,2,1,14,1,2,2,14,1,6,1,4,2,2,1,52,2,5,1,5,1,15,2,13,2,2,1,13,1,2,4,267,1,4,1,5,1,4,1,50,1,2,3,4,1,6,1,52,15,2,1,15,1,2,1,12,1,10,1,4,2
(Haskell):YTAwMDAyNiBuID0gZiBhMDAwMDQwX2xpc3QgbiAxICgwXihuLTEpKSAxIHdoZXJlCmYgXyAgMSBxIGUgeSAgPSB5ICogZSAqIHEKZiBwcydAKHA6cHMpIHggcSBlIHkKfCBtID09IDAgICAgPSBmIHBzJyB4JyBwIChlKzEpIHkKfCBlID4gMCAgICAgPSBmIHBzIHggcSAwICh5ICogZSAqIHEpCnwgeCA8IHAgKiBwID0gZiBwcycgMSB4IDEgeQp8IG90aGVyd2lzZSA9IGYgcHMgeCAxIDAgeQp3aGVyZSAoeCcsIG0pID0gZGl2TW9kIHggcAphMDAwMDI2X2xpc3QgPSBtYXAgYTAwMDAyNiBbMS4uXQotLSBfUmVpbmhhcmQgWnVta2VsbGVyXywgQXVnIDI3IDIwMTE=
(PARI):YShuKT1sb2NhbChmKTsgaWYobjwxLDAsZj1mYWN0b3Iobik7IHByb2Qoaz0xLG1hdHNpemUoZilbMV0sZltrLDFdKmZbaywyXSkp
(PARI):YShuKT1teShmPWZhY3RvcihuKSk7IGZhY3RvcmJhY2soZlssMV0pKmZhY3RvcmJhY2soZlssMl0pIFxcIF9DaGFybGVzIFIgR3JlYXRob3VzZSBJVl8sIEFwciAwNCAyMDE2
Where the first entry is the cached first 100 terms, and subsequent entries are actually algorithms stored in Base64. That's as far as I've gotten, but I'm looking to make a hybrid interpreter that passes the algorithm to one of the following language's interpreters:
['Haskell','Sage','Maxima','Python','PARI','MAGMA']
And returns the output of the executed code. Of course this has been buggy as hell and progress is slow, mostly because this is just a lark... But I'm still giving it a shot I suppose.