Testing if a Number is Prime

A positive whole number  
\[n\]
  is prime if it is divisible by just two numbers - 1 and itself.
1 is not a prime number.
We can test if a number  
\[n\]
  is prime by dividing by all the whole numbers up to and including  
\[\]
.
We need not go so far. In fact we need only divide by the prime numbers up to  
\[\sqrt{n}\]
.
Example: is 77 prime?\[\sqrt{77} =8.7....\]
  so we nee only divide by prime numbers up to and including 8.
. These are 2, 3, 5, 7
\[\frac{77}{2}=38.5\]

\[\frac{77}{3}=32.66666....\]

\[\frac{77}{5}=15.4\]

\[\frac{77}{7}=11\]

Hence  
\[77=11 \times 7\]
  is nor prime.

Add comment

Security code
Refresh