Nth Power Counter

Design a Python function to compute the amount of n-th powers within a certain range.

Design a Python function that determines the count of perfect n-th powers within a given range. A perfect power refers to a number that can be expressed as an integer raised to the power of another integer. For instance, the numbers `49` and `64` are perfect 2nd powers within the range `[49, 65]`, hence the output is `2`. ### Parameters - `n`: An integer representing the power. - `a` : An integer defining the start of the range to search for perfect powers. - `b` : An integer defining the end of the range to search for perfect powers. ### Return Value - The function must return the number of perfect n-th powers within the range, including the endpoints. ### Examples ```python # There are two 2nd powers within the range [49, 65]: 49 (7 ^ 2) and 64 (8 ^ 2). solution(2, 49, 65) # Returns: 2 # Three 3rd powers exist within the range [1, 27]: 1 (1 ^ 3), 8 (2 ^ 3) and 27 (3 ^ 3). solution(3, 1, 27) # Returns: 3 solution(10, 1, 5) # Returns: 1 solution(4, 250, 1300) # Returns: 3 ```