Solving Programming Puzzles Without Using Your Brain
doisinkidney.com
doisinkidney.com
This has led to some pretty major insights, which one can carefully 'launder' casually as something you knew all along. "Oh, of course the number of subtrees can be found by half-Catalan numbers", you say, with aplomb, as if you hadn't learned about half-Catalan numbers approximately 10 minutes ago.
Also, there's a simpler pattern to the sequence that is easily observable without even opening OEIS.
Although I think even if I had spotted that I still would have put it into oeis to see if there was a quick membership test.
Very neat little article.
3, 5; 6, 10; 9, 15...
So now, instead of having to test 6, 10 and 9, 15 when we see it, we can just test 3, 5 once and we'll know the answer to all of the points on that line. Then, to answer the question "which line is this point on?" we simplify the fraction (i.e. 2, 6 -> 1, 3).Instead of rolling his own, the author could have just used Python's Hypothesis package.[1][2]