Concept Flow - Check if Number is Prime
Start with number n
Check if n <= 1?
Yes→Not Prime, Stop
No
Set divisor = 2
Is divisor * divisor <= n?
No→Prime, Stop
Yes
Check if n % divisor == 0?
Yes→Not Prime, Stop
No
Increment divisor by 1
↩Back to divisor * divisor <= n check
Start by checking if the number is less than or equal to 1. If yes, it is not prime. Otherwise, test divisors from 2 up to the square root of the number. If any divisor divides the number evenly, it is not prime. If none do, it is prime.
