var max = 10000, min = 1000;
Math.round(Math.random() * (max - min) + min)
var array1 = [22, 25, 30];
var array2 = [2, 5, 10];
var n1 = array1[0], n2 = array1[1], n3 = array1[2];
var n4 = array2[0], n5 = array2[1], n6 = array2[2];
while(true) {
if(n4 !== n1) n4++;
if(n5 !== n2) n5++;
if(n6 !== n3) n6++;
console.log(n4, n5, n6);
if((n4+n5+n6) === (n1+n2+n3)) break;
}