Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The On-Line Encyclopedia of Integer Sequences (oeis.org)
160 points by pseudolus on April 17, 2021 | hide | past | favorite | 31 comments


The best description of the OEIS I've heard is by Donald Knuth in this fun talk (https://youtu.be/BxQw4CdxLr8) where at 19:50 he says how it lets you "compute your way into the literature":

> For the last 30 years or more, there has been a wonderful tool for all kinds of problems of this form and it's been online for a long time: we have the Online Encyclopedia of Integer Sequences. And this is just the nicest thing since sliced bread for mathematics because you can compute your way into the literature. [audience laughter] If you want to know if anybody else has ever studied a problem, all you have to do is evaluate the first few cases of it and then you look it up and there it is. The hit rate is incredible, and all kinds of mathematicians have discovered each other through the OEIS. […] I donate to Wikipedia and the Internet Archive and the OEIS.

(Aside: A good blog post about that lecture: https://thenewstack.io/donald-knuths-christmas-tree-lecture-...)

Indeed I've used it this way many times; the most recent example is that I became curious about how many polynomial functions there are mod n (after posting this comment: https://news.ycombinator.com/item?id=26482028), and by computing the answers for n up to 10, I was able to look up up those numbers in the OEIS and find the general formula, and also the relevant papers. (Asked a question about it here: https://math.stackexchange.com/questions/4070051/how-many-di... but ended up answering it myself…) I don't think I'd have even known where to look (as I'm not a professional mathematician), if not for the OEIS. And this happens again and again.


I have answered more than a few "what does this code do?" by just doing that.

Feed the code some numbers, look for the output in oeis and bam! Instant guru status.


What were the contexts in which you needed to examine a sequence of numbers transformed through a bit of code?

I'm assuming it's something more niche than CRUD development.

(I'm just curious, but would understand if it's something you can't talk about.)


It is less exciting than you think. I am not a programmer by profession.

One example is here: https://www.reddit.com/r/scheme/comments/k3b3hg/need_a_littl...

I have other more recent (and better) examples, but most are in closed forums or IRC l.


Always great. A fine technique to compensate for those of us who lack mathematical sophistication: write some godawful brute force code to calculate the number of items in some construct of interest, then search those numbers up to learn all sorts of useful new things about what you have.

I learned about generalizations of the Fibonacci sequence and "half-Catalan numbers" by this method.



Neil's got his own channel and just posted an accessible talk about cellular automata and other open problems. He could use some views!

https://www.youtube.com/watch?v=9ogbsh8KuEM


The OEIS is so useful when I have some sequence and I have no clue how to efficiently implement it in code.

More often than not, there's a formula to generate the ith term in the sequence in close to O(1) time.


I've been involved in a few of these sequences. The most recent is this one:

https://oeis.org/A294249

My early calculations have been superseded so I'm no longer mentioned, but I was involved in the initial calculations for this sequence:

https://oeis.org/A013998

It's an interesting and useful project. Any time you have a thing you don't understand it's worth finding some way of converting it to an integer sequence and then looking it up, just in case.


If curious, past threads:

The On-Line Encyclopedia of Integer Sequences - https://news.ycombinator.com/item?id=21366618 - Oct 2019 (28 comments)

The online encyclopaedia of integer sequences - https://news.ycombinator.com/item?id=18524115 - Nov 2018 (3 comments)

The On-Line Encyclopedia of Integer Sequences [pdf] - https://news.ycombinator.com/item?id=18015493 - Sept 2018 (4 comments)

The On-Line Encyclopedia of Integer Sequences - https://news.ycombinator.com/item?id=15900294 - Dec 2017 (1 comment)

Pictures from the On-Line Encyclopedia of Integer Sequences - https://news.ycombinator.com/item?id=11711212 - May 2016 (5 comments)

The Surprising Power of Neil Sloane’s Encyclopedia of Integer Sequences - https://news.ycombinator.com/item?id=10435690 - Oct 2015 (7 comments)

The On-Line Encyclopedia of Integer Sequences - https://news.ycombinator.com/item?id=9919535 - July 2015 (19 comments)

Neil Sloane: the man who loved only integer sequences - https://news.ycombinator.com/item?id=9380292 - April 2015 (2 comments)

The On-Line Encyclopedia of Integer Sequences - https://news.ycombinator.com/item?id=6650490 - Oct 2013 (20 comments)

The On-Line Encyclopedia of Integer Sequences - https://news.ycombinator.com/item?id=2496629 - April 2011 (7 comments)

The On-Line Encyclopedia of Integer Sequences - https://news.ycombinator.com/item?id=888577 - Oct 2009 (2 comments)

I thought there were larger ones...perhaps somebody will find one.


I like the self-referential sequences, like “Numbers n such that OEIS sequence A_n contains n.” https://oeis.org/A053873


I like the closely related "Numbers n such that OEIS sequence A_n doesn't contain n.”


I like how everybody here uses this website for some profound mathematical purposes, but I once won a cordless drill due to the OEIS in high school. At some hackathon Bosh had a booth with a contest where you had to solve puzzles which consiststed mainly of finishing integer sequences. I remembered this encyclopedia and I found all of them on the oeis.


It is regularly used in coding contests too where some hard challenge can sometimes be found out to be some maths formula.


Yeah, OEIS also helps with quite a few Project Euler problems.

https://projecteuler.net



Thanks for reminding me of this.

It's very useful identifying known patterns and also discovering new patterns by entering random number strings



There is also an attempt [1] to collect and (largely) synthesize a program for every OEIS sequence in an intentionally constrained DSL.

[1] https://github.com/ckrause/loda


Thanks for this link. I am working on a superoptimizer and once had the thought that OEIS would be a cool place to look for workloads. It's gratifying that someone else is doing this and having some success.


>In total, there are currently more than 26,000 programs available

Wow, lot of work has gone to it. Why the decision to utilize an assembly language?


As far as I can tell its assembly language is designed for fast synthesis and check (e.g. all programs are known to terminate). There is a "miner" generating programs and checking against existing sequences 24/7, a Twitter bot is also available [1].

[1] https://twitter.com/lodaminer


The OEIS is an amazing tool. I recently came across a sequence from an unusual source and then made the shocking discovery that the sequence already existed. It turned out to be a wild coincidence.

Write-up here: https://nickdrozd.github.io/2021/04/12/math-fact-busy-beaver...


The OEIS can also be considered a sort of number encyclopedia, especially for large numbers.

It can also be interesting to link geometric observations with unrelated OEIS sequences. For example, the number of rectangles on a square grid turned out to be the octagonal pyramidal numbers.


I suggest a mega-CISC architecture where all of those sequences are represented by an opcode.


I love this site. Often if I solve a Project Euler problem of the form "what is the xth element...", after I solve it, I will look at the first several elements in the sequence and start seeing where else the sequence is used.


https://oeis.org/A27

Looking at the URL, they got 26 sequences in (including the 0 sequence) before someone added the counting numbers.


What programming language are the sequences coded in? Is the code available?


The sequences are listed, and in each entry there are usually examples given of how to compute the sequence in multiple programming languages.


This is great for Advent of Code:)


There're few times some well-known sequences have appeared in AoC. Examples are Manhattan distances (OEIS:A214526) and square sums spiral (OEIS:A141481) in 2017d3, tribonacci (OEIS:A000073) in 2020d10, and Van Eck's sequence (OEIS:A181391) in 2020d15.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: