Using memoize, in clojure, for super fast and easy dynamic programming. Still too slow, though
Not enough for 1 million