f(N)=1^1*2^2*…(N-1)^(N-1)*N^N;
f(5)=1^1*2^2

*3^3*4^4*5^5=86400000.for N=5 this is too big,so how can i compute for N<=10^5.Is there any efficient algorithm for that.I have managed to get for small N.can any one hint me for such an algorithm .thanks in advance.