






# Algorithm for the pigeonhole sorting



def      _lowerCamelCase	(						__A    :							str )      ->					List[str]:
    _UpperCAmelCase				:      Optional[int]			  =				min(__A )  # min() finds the minimum value
    _UpperCAmelCase				:      Optional[int]			  =				max(__A )  # max() finds the maximum value

    _UpperCAmelCase				:      List[str]			  =				max_val - min_val + 1  # size is difference of max and min values plus one

    # list of pigeonholes of size equal to the variable size
    _UpperCAmelCase				:      List[Any]			  =				[0] * size

    # Populate the pigeonholes.
    for x in a:
        assert isinstance(__A		,		__A ), "integers only please"
        holes[x - min_val] += 1

    # Putting the elements back into the array in an order.
    _UpperCAmelCase				:      List[str]			  =				0
    for count in range(__A ):
        while holes[count] > 0:
            holes[count] -= 1
            _UpperCAmelCase				:      List[str]			  =				count + min_val
            i += 1

def      _lowerCamelCase	(						)      ->					Optional[int]:
    _UpperCAmelCase				:      Optional[Any]			  =				[8, 3, 2, 7, 4, 6, 8]
    pigeonhole_sort(__A )
    print('''Sorted order is:'''		,		''' '''.join(__A ) )


if __name__ == "__main__":
  main()












import math

def      _lowerCamelCase	(						__A    :							int )      ->					int:

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

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

        _UpperCAmelCase				:      Dict			  =				[3, 5]
        _UpperCAmelCase				:      Tuple			  =				2
        _UpperCAmelCase				:      Dict			  =				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(11):
    SCREAMING_SNAKE_CASE 							=						0
    try:
      SCREAMING_SNAKE_CASE 							=						proth(number)
    except ValueError:
      print(F'ValueError: there is no {number}th Proth number')
      continue

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




