update primality