def jacobi_witness(x, n):
 j = (jacobi(x, n) % n)
 f = pow(x, (n >> 1), n)
 if (j == f):
  return False
 return True

def jacobi_witness ( x , n ) : j = ( jacobi ( x , n ) % n ) f = pow ( x , ( n >> 1 ) , n ) if ( j == f ) : return False return True
returns false if n is an euler pseudo-prime with base x .