Project Euler code using Python 3