954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with prime numbers

: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

addicted
Junior Poster in Training
57 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 
~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 
: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.

Lardmeister
Posting Virtuoso
1,749 posts since Mar 2007
Reputation Points: 407
Solved Threads: 44
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You