Function that returns true if n is a power of 5
function ispower ( n ) { if ( n < 125 ) return ( n == 1 n == 5 n == 25 ) ; if ( n % 125 != 0 ) return false ; else return ispower ( parseInt ( n / 125 ) ) ; }