If we already found the two smallest multiple of i
break ; } mul [ j ] . forEach ( k => { if ( mul [ i ] . length <= 1 ) { mul [ i ] . push ( k ) ; } } ) ; } } var ans = 1000000000 ; for ( var i = 1 ; i <= mx ; i ++ ) { if ( mul [ i ] . length <= 1 ) continue ;