Swap Pairs or Remove
JavaScript (ES6), 133

Recursive function.



F=(m,k=[])=&gt;(k[m]=m,f=m.map((x,i)=&gt;x%(w=x-(y=m[i+1]))==0&amp;y%w==0?m[m[i]=y,i+1]=x:0),k[m=m.filter((x,i)=&gt;f[i-1]|f[i])]?m.length:F(m,k))


Less golfed and not recursive

F=m=&gt;{
  for(k=[];!k[m];) // use k to find a repeated state and exit the loop
  {
    k[m]=1
    console.log(m)
    // loop for swap and mark swap position in array f
    f=m.map((x,i)=&gt;( 
      y=m[i+1], // next element
      w=x-y,    // difference
      x%w==0&amp;y%w==0 // if common divisor ...
        ?m[m[i+1]=x,i]=y // swap elements,mark with nonzero
        :0 // no swap, mark with 0
    ))    
    m=m.filter((x,i)=&gt;f[i-1]|f[i]) // remove elements not swapped
  }
  return m.length
}


Test



F=(m,k=[])=&gt;(k[m]=m,f=m.map((x,i)=&gt;x%(w=x-(y=m[i+1]))==0&amp;y%w==0?m[m[i]=y,i+1]=x:0),k[m=m.filter((x,i)=&gt;f[i-1]|f[i])]?m.length:F(m,k))

console.log=x=&gt;O.textContent+=x+'\n'

;[[1,1],[1,2],[1,2,3],[4,6,8],[99,1,3],[4,5,2,4],[12,4,6,3],[9,6,10,18]
,[ 55, 218, 654, 703, 948, 960 ],[ 954, 973, 925, 913, 924, 996, 927, 981, 905 ]]
.forEach(t=&gt;console.log(t+' -&gt; '+F(t)))
&lt;pre id=O&gt;&lt;/pre&gt;