def powerOfSum():
    listOfN = []
for base in range(2, 100):
    num = base
for _ in range(2, 10):
    num *= base
if sum(map(int, str(num))) == base:
    listOfN.append(num)
return sorted(listOfN)[:30]
powerOfSum()
Certain Power of Sum of Digits of N == N (running too slowly)