Is your number prime?

rrzeszu2 06 Apr 2009 03:28

Earlier in the semester, we were discussing different ways to check whether a given number is prime. One method that we talked about involved taking the square root of the number. If none of the prime numbers less than the square root divide the original number, then it is prime. Here is an interesting link that will run this algorithm really quickly. It will tell you if your number is prime, and if it isn't, it will give the smallest prime factor of your number. Pretty cool!