Prime
Number Algorithms
- Pick any number.
- Divide the number you picked by 2.
- If the number is evenly divisible by 2, write
“Not A Prime Number, Divisible By 2”
and stop, otherwise, continue.
- Divide the number by 3.
- If the number is evenly divisible by 3, write
“Not A Prime Number, Divisible By 3”
and stop, otherwise, continue.
- Divide the number by 5.
- If the number is evenly divisible by 5, write
“Not A Prime Number, Divisible By 5”
and stop, otherwise, continue.
- Divide the number by the next odd number.
- If the number is evenly divisible by the next
odd number, write “Not A Prime
Number, Divisible By ?”
(Putting in the number that you divided by).
- Keep dividing until your dividing number is
equal to, or greater than, your test number.
- If your test number is not divisible by any
of these numbers, then write: “(Test Number) Is A Prime Number”, filling
in the words “Test Number” with
the number you chose in the beginning.