Maximum GCD among all pairs ( i , j ) of first N natural numbers | Function to find the maximum GCD among all the pairs from first n natural numbers ; Return max GCD ; Driver Code
function maxGCD ( n ) { return parseInt ( n / 2 ) ; } var n = 4 ; document . write ( maxGCD ( n ) ) ;