Project Euler Ruby and Python