basic primality test