To check if a number n is prime, you only need to check for factors up to the square root of n.
This is because if n has a factor greater than its square root, it must also have a smaller factor
(since a factor is a number that divides n without leaving a remainder).
This method significantly reduces the number of checks needed to determine if a number is prime.
Usage
is_prime(n)
Value
(bool) TRUE if the number is prime, FALSE if the number is not prime