Having thought about this overnight it's quite likely that, for large exponents, the above code will not actually finish executing in our lifetime or, perhaps, ever.
Note that the time taken to execute BigInteger.pow() increases exponentially as the exponent increases (it's not linear as I thought my algorithm would theoretically be). on my box BigInteger.pow(100000) takes 1 second; pow(200000) takes 4 seconds and pow(500000), 27 seconds. My program does pow(100000) in 11 seconds and pow(200000) in 51 seconds.
It would therefore be more efficient to use BigInteger.pow(int) and use the modulus of Integer.MAX_VALUE in the above algorithm, rather than multiplying in a loop.
A really simple solution that would make sense for practical values (which, having gone through the hoops may be the answer you are looking for anyway) would be:
HTH
Jules