0

:rolleyes: I need some one to define prime numbers for me
A full definition, I am trying to write a program to determine wether a number is prime, print all prime numbers in a specific range ... e.t.c so i need a full definition of prime numbers, i know prime numbers are divisible only by one and theirselves, and when i remove all odd and even numbers from a set of numbers, i will be left with prime numbers.....
i think if i know more about prime numbers i can come up with something more.....

so i need someone to help

3
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by Lardmeister
0

:rolleyes: I need some one to define prime numbers for me
A full definition, I am trying to write a program to determine wether a number is prime, print all prime numbers in a specific range ... e.t.c so i need a full definition of prime numbers, i know prime numbers are divisible only by one and theirselves, and when i remove all odd and even numbers from a set of numbers, i will be left with prime numbers.....
i think if i know more about prime numbers i can come up with something more.....

so i need someone to help

I assume you are talking about whole numbers. If you remove all odd and even numbers from a set of numbers you have nothing left! However you can safely remove the number 1 and all even numbers. The rest of the numbers you have to test with the modulus operator to see if they leave a remainder. It's up to you to do this in an elegant loop.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.