Primality Test Algorithm

Unlike integer factorization, primality tests do not generally give prime factors, only say whether the input number is prime or not. factorization is thought to be a computationally difficult problem, whereas primality testing is relatively easy (its running time is polynomial in the size of the input).

Primality Test source code, pseudocode and analysis