

import random

from .binary_exp_mod import bin_exp_mod

def       a__					(		UpperCAmelCase							:      Any    ,			UpperCAmelCase							:      List[Any]=1_000      )  ->						Union[str, Any]:
  if n < 2:
    return False

  if n % 2 == 0:
    return n == 2

  # this means n is odd
  UpperCAmelCase	:							int						=			n - 1
  UpperCAmelCase	:							Any						=			0
  while d % 2 == 0:
    d /= 2
    exp += 1

  # n - 1=d*(2**exp)
  UpperCAmelCase	:							Optional[int]						=			0
  while count < prec:
    UpperCAmelCase	:							Dict						=			random.randint(2    ,			n - 1      )
    UpperCAmelCase	:							Union[str, Any]						=			bin_exp_mod(UpperCAmelCase__    ,			UpperCAmelCase__    ,			UpperCAmelCase__      )
    if b != 1:
      UpperCAmelCase	:							str						=			True
      for _ in range(UpperCAmelCase__      ):
        if b == n - 1:
          UpperCAmelCase	:							Any						=			False
          break
        UpperCAmelCase	:							Optional[int]						=			b * b
        b %= n
      if flag:
        return False
      count += 1
  return True


if __name__ == "__main__":
     _lowerCamelCase    :       Union[str, Any]        =							abs(int(input("Enter bound : ").strip()))
     print("Here\'s the list of primes:")
     print(", ".join(str(i) for i in range(n + 1) if is_prime_big(i)))








def       a__					(		UpperCAmelCase							:      int    ,			UpperCAmelCase							:      int      )  ->						str:
  if a < 0 or b < 0:
    raise ValueError('''the value of both inputs must be positive'''      )
  UpperCAmelCase	:							List[Any]						=			str(bin(UpperCAmelCase      )      )[2:]  # remove the leading "0b"
  UpperCAmelCase	:							List[str]						=			str(bin(UpperCAmelCase      )      )[2:]
  UpperCAmelCase	:							Optional[Any]						=			max(len(UpperCAmelCase      )    ,			len(UpperCAmelCase      )      )
  return "0b" + "".join(
      str(int('''1''' in (char_a, char_b)      )      )
      for char_a, char_b in zip(a_binary.zfill(UpperCAmelCase      )    ,			b_binary.zfill(UpperCAmelCase      )      )      )


if __name__ == "__main__":
     import doctest

     doctest.testmod()





