We're on Discord! Please join our server now if you don't want to miss anything! (More info) | Join the UCC4 contest! (More info)

* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: OEIS golfing!  (Read 487 times)

0 Members and 2 Guests are viewing this topic.

Offline Juju

  • aka Yuki Kagayaki aka J̵̭͕͇ù̞̭̝̯̦j̴̭̙̗͖͡ù͏͓̲̕
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Inside a walrus
  • Posts: 3231
  • Post Rating Ratio: +37/-2
  • Couch potato
    • jul.savard
    • juju2143
    • @juju2143
    • juju2143
    • @julosoft
    • juju-kun
    • /u/juju2143
    • juju2143
    • @juju2143
    • Juju's shed
  • Gender: Female
  • WalriiPoints: 99999
Re: OEIS golfing!
« on: July 09, 2018, 09:00:32 pm »
Bash/Ruby, xkcd2016, 160 bytes
Code: [Select]
curl http://oeis.org/stripped.gz|gzcat|sed 1,4d|ruby -F, -e'a=(0..29999).to_a;while gets;a-=(s=$_.split).slice(1,s.length-2).map{|x|x.to_i};end;p a.slice(0,20)'Returns the first 20 integers which do not appear in the example terms of another OEIS sequence. (Warning: it downloads the entire OEIS database which is a 22MB gzipped file, might want to download it first and cat it instead if you're going to run it more than once.)

At the time of writing this post, the first 50 uninteresting numbers are:

Code: [Select]
[17843, 20067, 20227, 20990, 22589, 22595, 22978, 23174, 23543, 23615, 23735, 23876, 23986, 24085, 24140, 24159, 24555, 24628, 25061, 25266, 25330, 25611, 25743, 25965, 26301, 26517, 26534, 26673, 26708, 26755, 27266, 27292, 27357, 27619, 27663, 27765, 27815, 27988, 28166, 28255, 28311, 28330, 28353, 28427, 28454, 28466, 28473, 28515, 28599, 28835]
(It doesn't qualify either because it's not really an OEIS sequence, require pulling up the entire OEIS database to calculate the sequence and might change at any time when someone submits a new sequence to the OEIS, but I still find it very interesting.)
« Last Edit: July 09, 2018, 09:27:23 pm by Juju »
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
On semi-hiatus until who knows when. CODEWALRUS 2.0 COMING SOON
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games