Product of factors of number | function to product the factors ; If factors are equal , multiply only once ; Otherwise multiply both ; Driver Code
function multiplyFactors ( n ) { let M = 1000000007 ; let i ; prod = 1 ; for ( i = 1 ; i * i <= n ; i ++ ) { if ( n % i == 0 ) { if ( n / i == i ) prod = ( prod * i ) % M ; else { prod = ( prod * i ) % M ; prod = ( prod * n / i ) % M ; } } } return prod ; } n = 12 ; document . write ( multiplyFactors ( n ) ) ;