python solution for problems on http://projecteuler.net/