If A and N are not coprime
if ( gcd ( A , N ) != 1 ) : NEW_LINE INDENT return false ; NEW_LINE DEDENT mod = Power ( A , ( N - 1 ) // 2 , N ) ; NEW_LINE if ( mod != 1 and mod != N - 1 ) : NEW_LINE INDENT return False ; NEW_LINE DEDENT