Find the largest value of power. Some numbers can be represented as perfect powers of other numbers. A number x can be represented as x = base^power for some integer base and power.

Given an integer x you have to find the largest value of power, such that base is also an integer.

Sample Input:
9
Sample Output:
2
Golfscript - 26 chars

~:x,{:b;x,{b?x=b*}%+}*$-1&gt;


Rough translation to Python

x=input()
acc = []
for b in range(x):
    for _ in range(x):
        acc.append((_**b==x)*b) # most of these are zeros
print max(acc)


So it loops way more times that necessary, but that often happens with golfed answers