


import math





def __UpperCAmelCase       (		__A			)						->					int:



       '''simple docstring'''





       if not isinstance(__A ,						__A			):
              UpperCAmelCase__										=     F"""Input value of [number={number}] must be an integer"""
              raise TypeError(__A			)

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

              UpperCAmelCase__										=     [3, 5]
              UpperCAmelCase__										=     2
              UpperCAmelCase__										=     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):
        A      = 0
        try:
            A      = proth(number)
        except ValueError:
            print(f"ValueError: there is no {number}th Proth number")
            continue

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









from .imports import is_tqdm_available


if is_tqdm_available():
    from tqdm.auto import tqdm as _tqdm

from ..state import PartialState





def __UpperCAmelCase       (		__A = True ,						*__A ,						**__A			)						->					Any:



       '''simple docstring'''





       if not is_tqdm_available():
              raise ImportError("Accelerate's `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`."			)
       UpperCAmelCase__										=     False
       if main_process_only:
              UpperCAmelCase__										=     PartialState().local_process_index == 0
       return _tqdm(*__A ,						**__A ,						disable=__A			)





