Returns largest power of B that divides N !
function largestPowerOfB ( N , B ) { var vec = [ ] ; vec = primeFactorsofB ( B ) ; var ans = Number . MAX_VALUE ; for ( var i = 0 ; i < vec . length ; i ++ )