Function to check if all the pairs of the array are coprime with each other or not
function allCoprime ( A , n ) { var all_coprime = true ; for ( var i = 0 ; i < n ; i ++ ) { for ( var j = i + 1 ; j < n ; j ++ ) {