Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
brute force e solution in Clear category for Checking Perfect Power by juestr
from itertools import count
def perfect_power(n: int) -> bool:
for e in count(2):
b = n ** (1/e)
if b < 1.99:
return False
elif round(b) ** e == n:
return True
Aug. 29, 2023