I think it was someone on this forum who posted code for finding if a number is prime or not without loops, using the definition "A prime number is a number which can only be divided by itself and one to return a positive integer". It was something like:
PHP Code:bool IsPrime ( int number )
{
if ( int(number / 1) ) return true;
if ( int(number / number) ) return true;
}




Reply With Quote