HELP: Is there a formula to figure out if a number is prime???

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

silverpig

Lifer
Jul 29, 2001
27,703
12
81
Well you can definitely rule out any numbers that end in a multiple of 2, any numbers where the sum of the digits add up to a number divisible by 3, any numbers ending in 5... That leaves you only having to test numbers that end in 3, 7, or 9. Do a test right away to see if the number in question ends with one of these numbers. If it does, test it further, if not, chuck it.
 

eakers

Lifer
Aug 14, 2000
12,169
2
0
if you break the number into its smallest factors they will be prime.

ie: 12 = 2*2*3
 

damiano

Platinum Member
May 29, 2002
2,322
1
0
Originally posted by: silverpig
Well you can definitely rule out any numbers that end in a multiple of 2, any numbers where the sum of the digits add up to a number divisible by 3, any numbers ending in 5... That leaves you only having to test numbers that end in 3, 7, or 9. Do a test right away to see if the number in question ends with one of these numbers. If it does, test it further, if not, chuck it.

so youare saying 11 is definitly not a prime number?!?!?!?!?!?!?!?!