Lucas primality test