var n=255, divisor = [], i = 3; while(i < n) { if(n % i == 0) divisor.push(i); i = i + 3; } alert(divisor);
var n=255; var divisor = []; if (n % 3 == 0) { divisor.push(3); n=Math.round(n/3); var max=n/2; for (var i=2; i<=max; i++) { if (n % i == 0) { divisor.push(3*i); }; }; divisor.push(3*n); }; alert(divisor);