

"""simple docstring"""





import math

def     __SCREAMING_SNAKE_CASE    ( A_					):

	if not isinstance(A_		,	A_					):
		lowerCAmelCase__      :		Tuple    							=      f'Input value of [number={number}] must be an integer'
		raise TypeError(A_					)

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

		lowerCAmelCase__      :		Dict    							=      [3, 5]
		lowerCAmelCase__      :		int    							=      2
		lowerCAmelCase__      :		Any    							=      3
		for block in range(1		,	A_					):
			for _ in range(A_					):
				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(1_1):
														__UpperCamelCase    : List[str]				 =						0
														try:
																					__UpperCamelCase    : Any				 =						proth(number)
														except ValueError:
																					print(F'''ValueError: there is no {number}th Proth number''')
																					continue

														print(F'''The {number}th Proth number: {value}''')







"""simple docstring"""





def     __SCREAMING_SNAKE_CASE    ( A_		,	A_					):
	if number < 0 or shift_amount < 0:
		raise ValueError('''both inputs must be positive integers'''					)

	lowerCAmelCase__      :		int    							=      str(bin(A_					)					)
	binary_number += "0" * shift_amount
	return binary_number

def     __SCREAMING_SNAKE_CASE    ( A_		,	A_					):
	if number < 0 or shift_amount < 0:
		raise ValueError('''both inputs must be positive integers'''					)

	lowerCAmelCase__      :		Any    							=      str(bin(A_					)					)[2:]
	if shift_amount >= len(A_					):
		return "0b0"
	lowerCAmelCase__      :		Tuple    							=      binary_number[: len(A_					) - shift_amount]
	return "0b" + shifted_binary_number

def     __SCREAMING_SNAKE_CASE    ( A_		,	A_					):
	if number >= 0:  # Get binary representation of positive number
		lowerCAmelCase__      :		Union[str, Any]    							=      '''0''' + str(bin(A_					)					).strip('''-'''					)[2:]
	else:  # Get binary (2's complement) representation of negative number
		lowerCAmelCase__      :		Optional[Any]    							=      len(bin(A_					)[3:]					)  # Find 2's complement of number
		lowerCAmelCase__      :		Optional[int]    							=      bin(abs(A_					) - (1 << binary_number_length)					)[3:]
		lowerCAmelCase__      :		int    							=      (
		    '''1''' + '''0''' * (binary_number_length - len(A_					)) + binary_number
		)

	if shift_amount >= len(A_					):
		return "0b" + binary_number[0] * len(A_					)
	return (
	    "0b"
	    + binary_number[0] * shift_amount
	    + binary_number[: len(A_					) - shift_amount]
	)


if __name__ == "__main__":
							import doctest

							doctest.testmod()




