is_perfect_power#

Return 1 when $x is a perfect power $a ** $b with $b > 1.

Synopsis#

Math::GMP->new(27)->is_perfect_power;    # 1 (3**3)
Math::GMP->new(28)->is_perfect_power;    # 0

Returns 0 otherwise. Detects any exponent — squares, cubes, fifth powers, and so on.