pEuler solution in python