This code, somewhat surprisingly, generates Fibonacci numbers. def fib(n): return (4 << n*(3+n)) // ((4 << 2*n) - (2 << n) - 1) & ((2 << n) - 1) In this blog post, I’ll explain where it comes from and how it works. Before getting to explaining, I’ll give a whirlwind background overview of Fibonacci numbers and how to compute them. If you’re already a maths whiz, you can skip most of the introducti