Solving https://projecteuler.net/ in Ruby & Python