If GCD of the sequence is K
if ( GCDArr ( ans ) == k ) { document . write ( " " ) ; let m = ans . length ; for ( let j = 0 ; j < m - 1 ; j ++ ) document . write ( ans [ j ] + " " ) ; document . write ( ans [ m - 1 ] + " " ) ; return true ; }