Non working solution. That's a lot of numbers to try to fit in memory.
Working version of problem 3.