I think this will work

exceptions = [2,4,6];

randomSeed=time*thisComp.frameDuration;

result=Math.round(Math.random(10));

while(exceptions.indexOf(result)!=-1){

randomSeed+=Math.round(Math.random(100));

result=Math.round(Math.random(10));

}

result

Andrei

My

Envato portfolio.