Utility function to check for primality of a number X by checking whether X haACCs any factors other than 1 and itself .
def isPrime ( X ) : NEW_LINE INDENT for i in range ( 2 , int ( sqrt ( X ) ) + 1 , 1 ) : NEW_LINE INDENT if ( X % i == 0 ) : NEW_LINE DEDENT DEDENT