I'm in serious need of help with a C++ based prime number generator. I have the program to create and run the code, but i dont have the knowledge to develop the code and I'm looking for one of you guys to build the code for me.
I need a prime number algorithm developed for C++
I have VERY specific guidelines as to the process in which the program calculates the result, all of which should make the program easier to run.
number being checked must not end in 2,4,5,6,8, or 0(reduces the amount of numbers needing checked by alot. valid statement by the fact that any number ending in 0, 2, 4, 5, 6, or 8 is automatically divisible and therefore, not prime.)
number must have no factors other than itself and 1(just to ensure the specification and definition of what a prime number is)
1 is not prime
if number does not end in 2,4,5,6,8, or 0 then the number need not be divided by 2, or 5 (reduces the number of factors needing checked by alot)
number being checked must be divided by 2,3,7, and any prime number less than the number being checked.(greatly reduces number of factors to check)
if, when divided, the number yields any whole value other than itself or 1, the number is not prime.
if, when divided by any factor less than itself, the number does not yield any whole value other than itself or 1 , the number is prime.
start with a number,
divide it by all numbers less than itself that fall within the division criterion,
check the results,
A) whole number on any result
B) decimal in all results
A) move to next number to be checked
B) set number into prime category for use in further calculations.
I understand that it might be hard to get things that specific into the programming, but any and all help would be greatly appreciated.