4
\$\begingroup\$

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:

https://oeis.org/A014258

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.

\$\endgroup\$
  • 10
    \$\begingroup\$ Valid: yes (because you could just manually code them all into the interpreter). Interesting: meh. \$\endgroup\$ – Martin Ender Jun 14 '17 at 19:00
  • \$\begingroup\$ @MartinEnder truth, maybe it'd be even more interesting if I coded the question IDs from the PPCG SE into it too. I've wanted to try writing an esolang without ripping off anyone else's idea. \$\endgroup\$ – Magic Octopus Urn Jun 14 '17 at 19:06
  • \$\begingroup\$ This looks kinda cool. You could have a lot of really useful built-ins ripped off from OEIS. \$\endgroup\$ – Gryphon Jun 14 '17 at 20:38
  • 1
    \$\begingroup\$ Side question: would a similar language that fetches sequences directly from the OEIS website be invalid? Why should requiring internet for some builtins be an undesirable property? \$\endgroup\$ – Leo Jun 17 '17 at 8:20
  • 1
    \$\begingroup\$ While kind of cheaty for any "print the nth term of this sequence" questions, I imagine this may have some surprisingly useful and interesting applications \$\endgroup\$ – Beta Decay Jun 17 '17 at 23:01
  • \$\begingroup\$ Question: Why can't the interpreter connect to OEIS? \$\endgroup\$ – CalculatorFeline Jun 18 '17 at 2:48
  • 1
    \$\begingroup\$ @CalculatorFeline Any code that causes the interpreter to connect to the OEIS would fall under the standard loophole “Fetching the desired output from an external source” (codegolf.meta.stackexchange.com/a/1062/6484) \$\endgroup\$ – Grimy Jun 19 '17 at 13:54
  • \$\begingroup\$ @carusocomputing Yes, I understand that. I was replying to CalculatorFeline’s comment: “Why can't the interpreter connect to OEIS?” \$\endgroup\$ – Grimy Jun 19 '17 at 14:11
  • \$\begingroup\$ Hmm...Interesting. I'm not sure why the difference between an interpreter that bundles OEIS and an interpreter that doesn't matters though. \$\endgroup\$ – CalculatorFeline Jun 19 '17 at 15:57
  • \$\begingroup\$ @CalculatorFeline Because then it's self-contained. \$\endgroup\$ – Magic Octopus Urn Jun 20 '17 at 13:45
  • \$\begingroup\$ So there would be 2 interpreters: the one everyone uses but is illegal and the legal one that's huge because it contains megabytes of OEIS data, used only when people need to prove correctness of the useful one. \$\endgroup\$ – CalculatorFeline Jun 20 '17 at 14:58
  • \$\begingroup\$ @CalculatorFeline what is Mathematica other than an 85MB file holding massive amounts of information relating to mathematical operations? There would be one interpreter. The offline one. \$\endgroup\$ – Magic Octopus Urn Jun 20 '17 at 15:08
  • \$\begingroup\$ What if you don't want to download 85MB of OEIS data? \$\endgroup\$ – CalculatorFeline Jun 20 '17 at 15:23
  • \$\begingroup\$ @CalculatorFeline what if you don't want to install 182MB of Java 1.7.0_79? What if you don't want to install a ludicrous amount of crap to code in .NET? I don't get what you're attempting to argue here. \$\endgroup\$ – Magic Octopus Urn Jun 20 '17 at 15:29
  • 2
    \$\begingroup\$ Has this language been created yet? I'm still interested :) \$\endgroup\$ – Beta Decay Jul 3 '17 at 22:54
10
\$\begingroup\$

Yes

It's no different then if you just added them as builtins with no inspiration from the OEIS (however unlikely that would be). If your language can use sequences from the OEIS without connecting to the OEIS, there's no reason it would be disallowed.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .