Whole-number powers

Haskell, 38

f n=[b|b<-[1..n],n`elem`map(^b)[1..n]]

Pretty straightforward. The list comprehension finds values of b for which the input n appears among [1^b, 2^b, ..., n^b]. It suffices to check b in the range [1..n].


Pyth, 10 bytes

f}Q^RTSQSQ

Demonstration

For each power, it generates the list of all numbers up to the input taken to that power, and then checks if the input is in the list.


Python 2, 53

lambda n:[i/n for i in range(n*n)if(i%n+1)**(i/n)==n]

Brute forces all combinations of bases in exponents in [0, n-1] and bases in [1, n].