Project Euler in Python 3