Checking if the difference of non - zero oddbits and evenbits is divisible by 3.
if ( Math . abs ( oddbits - evenbits ) % 3 == 0 ) { document . write ( " " + " " ) ; } else { document . write ( " " + " " ) ; } }