



from __future__ import annotations

from collections.abc import Sequence
from typing import Literal





def 		a__      (		_UpperCamelCase      :			str			,_UpperCamelCase      :			str				):
   __lowerCamelCase    				=     list(_UpperCamelCase				)
   __lowerCamelCase    				=     list(_UpperCamelCase				)
   __lowerCamelCase    				=     0
   for i in range(len(_UpperCamelCase				)				):
      if lista[i] != lista[i]:
         count += 1
         __lowerCamelCase    				=     '''_'''
   if count > 1:
      return False
   else:
      return "".join(_UpperCamelCase				)





def 		a__      (		_UpperCamelCase      :			list[str]				):
   __lowerCamelCase    				=     []
   while True:
      __lowerCamelCase    				=     ['''$'''] * len(_UpperCamelCase				)
      __lowerCamelCase    				=     []
      for i in range(len(_UpperCamelCase				)				):
         for j in range(i + 1			,len(_UpperCamelCase				)				):
            __lowerCamelCase    				=     compare_string(binary[i]			,binary[j]				)
            if k is False:
               __lowerCamelCase    				=     '''*'''
               __lowerCamelCase    				=     '''*'''
               temp.append('''X'''				)
      for i in range(len(_UpperCamelCase				)				):
         if checka[i] == "$":
            pi.append(binary[i]				)
      if len(_UpperCamelCase				) == 0:
         return pi
      __lowerCamelCase    				=     list(set(_UpperCamelCase				)				)





def 		a__      (		_UpperCamelCase      :			int			,_UpperCamelCase      :			Sequence[float]				):
   __lowerCamelCase    				=     []
   for minterm in minterms:
      __lowerCamelCase    				=     ''''''
      for _ in range(_UpperCamelCase				):
         __lowerCamelCase    				=     str(minterm % 2				) + string
         minterm //= 2
      temp.append(_UpperCamelCase				)
   return temp





def 		a__      (		_UpperCamelCase      :			str			,_UpperCamelCase      :			str			,_UpperCamelCase      :			int				):
   __lowerCamelCase    				=     list(_UpperCamelCase				)
   __lowerCamelCase    				=     list(_UpperCamelCase				)
   __lowerCamelCase    				=     0
   for i in range(len(_UpperCamelCase				)				):
      if lista[i] != lista[i]:
         count_n += 1
   return count_n == count





def 		a__      (		_UpperCamelCase      :			list[list[int]]			,_UpperCamelCase      :			list[str]				):
   __lowerCamelCase    				=     []
   __lowerCamelCase    				=     [0] * len(_UpperCamelCase				)
   for i in range(len(chart[0]				)				):
      __lowerCamelCase    				=     0
      __lowerCamelCase    				=     -1
      for j in range(len(_UpperCamelCase				)				):
         if chart[j][i] == 1:
            count += 1
            __lowerCamelCase    				=     j
      if count == 1:
         __lowerCamelCase    				=     1
   for i in range(len(_UpperCamelCase				)				):
      if select[i] == 1:
         for j in range(len(chart[0]				)				):
            if chart[i][j] == 1:
               for k in range(len(_UpperCamelCase				)				):
                  __lowerCamelCase    				=     0
         temp.append(prime_implicants[i]				)
   while True:
      __lowerCamelCase    				=     0
      __lowerCamelCase    				=     -1
      __lowerCamelCase    				=     0
      for i in range(len(_UpperCamelCase				)				):
         __lowerCamelCase    				=     chart[i].count(1				)
         if count_n > max_n:
            __lowerCamelCase    				=     count_n
            __lowerCamelCase    				=     i

      if max_n == 0:
         return temp

      temp.append(prime_implicants[rem]				)

      for i in range(len(chart[0]				)				):
         if chart[rem][i] == 1:
            for j in range(len(_UpperCamelCase				)				):
               __lowerCamelCase    				=     0





def 		a__      (		_UpperCamelCase      :			list[str]			,_UpperCamelCase      :			list[str]				):
   __lowerCamelCase    				=     [[0 for x in range(len(_UpperCamelCase				)				)] for x in range(len(_UpperCamelCase				)				)]
   for i in range(len(_UpperCamelCase				)				):
      __lowerCamelCase    				=     prime_implicants[i].count('''_'''				)
      for j in range(len(_UpperCamelCase				)				):
         if is_for_table(prime_implicants[i]			,binary[j]			,_UpperCamelCase				):
            __lowerCamelCase    				=     1

   return chart





def 		a__      (		):
   __lowerCamelCase    				=     int(input('''Enter the no. of variables\n'''				)				)
   __lowerCamelCase    				=     [
       float(_UpperCamelCase				)
       for x in input(
           '''Enter the decimal representation of Minterms \'Spaces Separated\'\n'''				).split()
   ]
   __lowerCamelCase    				=     decimal_to_binary(_UpperCamelCase			,_UpperCamelCase				)

   __lowerCamelCase    				=     check(_UpperCamelCase				)
   print('''Prime Implicants are:'''				)
   print(_UpperCamelCase				)
   __lowerCamelCase    				=     prime_implicant_chart(_UpperCamelCase			,_UpperCamelCase				)

   __lowerCamelCase    				=     selection(_UpperCamelCase			,_UpperCamelCase				)
   print('''Essential Prime Implicants are:'''				)
   print(_UpperCamelCase				)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()











from __future__ import annotations





def 		a__      (		_UpperCamelCase      :			int | float | str			,_UpperCamelCase      :			int | float | str				):
   if nth_term == "":
      return [""]
   __lowerCamelCase    				=     int(_UpperCamelCase				)
   __lowerCamelCase    				=     int(_UpperCamelCase				)
   __lowerCamelCase    				=     []
   for temp in range(int(_UpperCamelCase				)				):
      series.append(F"""1 / {pow(temp + 1			,int(_UpperCamelCase				)				)}""" if series else '''1'''				)
   return series


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  a_								=       int(input("""Enter the last number (nth term) of the P-Series"""))
  a_								=       int(input("""Enter the power for  P-Series"""))
  print("""Formula of P-Series => 1+1/2^p+1/3^p ..... 1/n^p""")
  print(p_series(nth_term, power))






