Realize primality test function and UI.