First time here? Check out the FAQ!
answered 2020-04-16 17:20:38 +0100
You can use the is_prime_power method:
is_prime_power
sage: a = 3**15 sage: a.is_prime_power() True sage: a.is_prime_power(get_data=True) (3, 15)