





'''simple docstring'''




from math import pi, sqrt






def 	_lowerCAmelCase      (  __snake_case  :			float      )					->					Optional[Any]:
     if num <= 0:
          raise ValueError('math domain error'      )
     if num > 1_71.5:
          raise OverflowError('math range error'      )
     elif num - int(lowerCAmelCase__      ) not in (0, 0.5):
          raise NotImplementedError('num must be an integer or a half-integer'      )
     elif num == 0.5:
          return sqrt(lowerCAmelCase__      )
     else:
          return 1.0 if num == 1 else (num - 1) * gamma(num - 1      )






def 	_lowerCAmelCase      (  )					->					int:
     assert gamma(0.5      ) == sqrt(lowerCAmelCase__      )
     assert gamma(1      ) == 1.0
     assert gamma(2      ) == 1.0


if __name__ == "__main__":
  from doctest import testmod

  testmod()
  lowercase__   :				Tuple      =   1.0
  while num:
    lowercase__   :				str      =   float(input('''Gamma of: '''))
    print(f"""gamma({num}) = {gamma(num)}""")
    print('''\nEnter 0 to exit...''')








'''simple docstring'''




import math






def 	_lowerCAmelCase      (  __snake_case  :			int      )					->					int:

     if not isinstance(__snake_case			,							__snake_case      ):
          __A						:			List[Any]								=	f'Input value of [number={number}] must be an integer'
          raise TypeError(__snake_case      )

     if number < 1:
          __A						:			Union[str, Any]								=	f'Input value of [number={number}] must be > 0'
          raise ValueError(__snake_case      )
     elif number == 1:
          return 3
     elif number == 2:
          return 5
     else:
          __A						:			Optional[Any]								=	int(math.log(number // 3			,							2      )      ) + 2

          __A						:			Union[str, Any]								=	[3, 5]
          __A						:			List[Any]								=	2
          __A						:			Optional[Any]								=	3
          for block in range(1			,							__snake_case      ):
               for _ in range(__snake_case      ):
                    proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1]      )
                    proth_index += 1
               increment *= 2

     return proth_list[number - 1]


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  for number in range(11):
    lowercase__   :				str      =   0
    try:
      lowercase__   :				List[str]      =   proth(number)
    except ValueError:
      print(f"""ValueError: there is no {number}th Proth number""")
      continue

    print(f"""The {number}th Proth number: {value}""")