Ported 1 solution of project euler to Python3