To test whether a number is prime or not, why do we have to test whether it is divisible only up to the square root of that number?
Sal proves that the square root of any prime number must be an irrational number. For example, because of this proof we can quickly determine that √3, √5, √7, or √11 are irrational numbers.
Prime factorization is one of the methods used to find the Greatest Common Factor (GCF) of a given set of numbers. GCF by prime factorization is useful for larger numbers for which listing all the factors is time-consuming.
The simplest primality test is trial division: given an input number, n, check whether it is evenly divisible by any prime number between 2 and √n (i.e. that the division leaves no remainder). If so, then n is composite. Otherwise, it is prime.
If a number n
is not a prime, it can be factored into two factors a
and b
:
n = a * b
Now a
and b
can't be both greater than the square root of n
, since then the product a * b
would be greater than sqrt(n) * sqrt(n) = n
. So in any factorization of n
, at least one of the factors must be smaller than the square root of n
, and if we can't find any factors less than or equal to the square root, n
must be a prime.
Let's say m = sqrt(n)
then m × m = n
. Now if n
is not a prime then n
can be written as n = a × b
, so m × m = a × b
. Notice that m
is a real number whereas n
, a
and b
are natural numbers.
Now there can be 3 cases:
In all 3 cases, min(a, b) ≤ m
. Hence if we search till m
, we are bound to find at least one factor of n
, which is enough to show that n
is not prime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With