Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The On-Line Encyclopedia of Integer Sequences (oeis.org)
63 points by colinprince on July 20, 2015 | hide | past | favorite | 19 comments


The way I think about it is less as an encyclopedia of sequences per se than it is a kind of projection of mathematics onto sequence-space. The point being that an integer sequence, because it often has so many mathematical interpretations, acts in some sense like the intersection of those interpretations. There are of course many ways in which two or more mathematical concepts are linked, but a shared integer sequence is among the most useful, precisely because it can be browsed and searched like an encyclopedia.


That's a pretty thought


I've used OEIS a number of times for obscure mathematical problems in programming competitions. It's a pretty useful resource!


Could you please elaborate to a less mathematically inclined dev how to spot a problem the would fit the bill and then how to use this encyclopedia properly?

It's one of these things I seem to have been born blind towards.


Well, the last time it helped me was as a "reverse lookup" for math knowledge I never got the "right" way through education.

For example, one of the Google-Foobar puzzles involves how many ways you can order a line of different-height elements so that only a certain number are "visible" if you stood at one end of the line or the other.

First I tried to figure out how I would solve it for small numbers by hand, creating a spreadsheet of inputs. At one point, I got a grid of numbers where the "simpler" rows/columns had a sequence like 1, 1, 1, 2, 3, 1, 6, 11, 6, which, through random googling and OEIS turned out to be "Unsigned Stirling numbers of the first kind"

http://oeis.org/A008275 https://en.wikipedia.org/wiki/Stirling_numbers_of_the_first_...

Alas, I'm still no math-major... the comments in my solution contain: "I'm extremely proud of this boiled-down end-result... except that I'm not sure I can fully explain why it works."


Some real ones from TopCoder in my experience (SRM 401, Div 1): http://apps.topcoder.com/forums/?module=Thread&threadID=6126...

(SRM 363, HandShake problem): http://apps.topcoder.com/forums/?module=Thread&threadID=5843...

The idea is you brute force or hand calculate the first few numbers and then use the OEIS's wild card search.


I've used it often to solve IBM's Ponder This puzzles. A dirty way to solve a puzzle is often to get a few values manually. These often are fractions, so there is a bit of an art in adjusting numerator and denominator so that the numerator sequence and denominator sequence both look somewhat regular. Then you look up those sequences in OEIS.


Same here, I've been doing 'online judge' type of contests quite a lot in high school and college and one of the first thing to try was basically solve for small numbers by hand and then try oeis. Love this site, still have it bookmarked.


Interesting profile of the founder of this site: http://www.theguardian.com/science/alexs-adventures-in-numbe...


Speaking as a non-mathematician, it's one of those resources you didn't know you needed until that one time you have some sequence of numbers and wanted to figure out if they meant something special.


Like the very known sequence? ;) http://oeis.org/A104101


Heh, no, but two that I did "find in the wild":

http://oeis.org/A195581

http://oeis.org/A008275


One of the best OEIS sequences in terms of user comments is surely A000027 (the positive integers, sure to be filled with silly 'explanations'). My favorites:

a(n) is also the number of permutations simultaneously avoiding 213, 231 and 321 in the classical sense which can be realized as labels on an increasing strict binary tree with 2n-1 nodes. See A245904 for more information on increasing strict binary trees. - Manda Riehl

Number of n-digit numbers the binary expansion of which contains one run of 1's. - Vladimir Shevelev


A000012 is the all-ones sequence: https://oeis.org/A000012. It even has a subreddit: https://www.reddit.com/r/A000012/


Written in Go. :-)


Where did you find that? The service existed a long time before Go was created.


That's because Russ Cox (rsc) is the very person who has rewritten a decade-old software for OEIS, as seen in the OEIS foundation page:

> It took us over a year to resolve this problem. In the end, Russ Cox completely rewrote all the programs needed to maintain the database and answer queries - a huge task! NJAS's colleague David Applegate has also been of enormous help in getting the new system working.

(http://oeisf.org/index.html#HISTORY)


It's true. The original software was an email auto-reply implemented in shell. The first web version of the software was CGI invoking roughly the same shell script. I didn't have anything to do with those. The next web version (which I wrote in ~2006) was CGI invoking C with an mmap'ed index file. The third web version (which I wrote in ~2010 and is the one running today) is a Go HTTP server, fronted by Apache.

Note that I'm only talking about the software for the "interactive" UI, not the database itself. The database itself goes back to punched cards and the original interactive UI was a pair of published books (first A Handbook of Integer Sequences, and then the Encyclopedia of Integer Sequences).


My favorite sequence I learned from this:

Decimal expansion of (7^(e - 1/e) - 9)*Pi^2, also known as Jenny's constant.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: