**math in programming, please help**

could anyone show me an algorithm to test if a input number is prime or not. thing is that i knew an algorithm already (the easiest one - keep dividing the input number with numbers smaller than its squaroot), but i want to know if there is a better alg out there. i just need the algorithm, you dont have to write the code for me

thanks

Last edited by a moderator: Oct 27, 2004