4 ms·
> You check set membership with ∈ Yeah, ok, I see what you mean. >> 0,2,4...10 > (0 2 4 6 8 10) >> 1,2,4...10 > (1 2 4 8) Wait... what? Is it looking the
by flir 3y ago
> You check set membership with ∈
Yeah, ok, I see what you mean.
>> 0,2,4...10
> (0 2 4 6 8 10)
>> 1,2,4...10
> (1 2 4 8)
Wait... what? Is it looking the next number up in OEIS or something?
- anthk 3y agoDamn, that made me laugh.
- kragen 3y agoUnable to deduce arithmetic or geometric sequence from: 1,2,5 Did you really mean '..'?
- flir 3y ago> arithmetic or geometric See, that doesn't delight me. OEIS is what's needed here.
- hwayne 3y agoWelp now I know what "using it in anger" is gonna look like
- deleted 3y ago[deleted]
- nerdponx 3y agoMaybe there's some way to extend the compiler to use OEIS. Is there a "liboeis" that lets you download and interact with the OEIS database offline?
- anthk 3y agoThere's must be one or two for either Python or Perl. Well: https://github.com/sidneycadot/oeis https://github.com/sidneycadot/oeis
- Dylan16807 3y agoDo you want it to take the first match? Inputting a unique prefix doesn't sound practical.
- flir 3y agoI thought about that. I thought the compiler could error with "Insufficient data for meaningful answer" until you'd added enough digits that the sequence was unambiguous. Then I tried it in OEIS and as you say there are too many sequences that start [1,2,3,4,5,...] - I think we may be stuck with generators and yield. But they're not exactly delightful.
- Sharlin 3y ago> "Insufficient data for meaningful answer" Nice reference, by the way.
- kragen 3y agooh fuck, i missed that
- mst 3y agoConvert https://trout.me.uk/data.jpg https://trout.me.uk/data.jpg to sixels and have the compiler emit that?
- flir 3y ago> sixels Thanks! My build scripts just got that little bit more entertaining (for me. not for the other devs).
- kragen 3y agoyou could special-case arithmetic sequences
- codeflo 3y agoThat would lead to weird behavior since the OEIS is sorted by number of references, which I think prefers "interesting" solutions over straightforward ones. For (1, 2, 3), the positive integers are only ranked 5th -- the top hit are the Fibonacci numbers. It's funny to think about.
- SyrupThinker 3y agoWell… that was supposedly considered at some point: https://youtube.com/watch?v=BJIfPFpaMRI&t=1891 https://youtube.com/watch?v=BJIfPFpaMRI&t=1891 (~1m)
- vanderZwan 3y agoHeh, even Larry Wall says "no, that way lies madness" (now I want to see it in an esolang precisely because he said that)
- mst 3y agoThis is much like my wanting to eventually resurrect my MicroVAX 2100 ... so I can install Eunice on it ... so I can get perl's Configure script to take the other branch of the test that reports "Congratulations, you aren't running Eunice" for real and take a photograph of it.