'''simple docstring'''




__SCREAMING_SNAKE_CASE	:					Dict					=  [0.4_8_5, 0.4_5_6, 0.4_0_6]
__SCREAMING_SNAKE_CASE	:					Any					=  [0.2_2_9, 0.2_2_4, 0.2_2_5]
__SCREAMING_SNAKE_CASE	:					List[str]					=  [0.5, 0.5, 0.5]
__SCREAMING_SNAKE_CASE	:					int					=  [0.5, 0.5, 0.5]
__SCREAMING_SNAKE_CASE	:					Union[str, Any]					=  [0.4_8_1_4_5_4_6_6, 0.4_5_7_8_2_7_5, 0.4_0_8_2_1_0_7_3]
__SCREAMING_SNAKE_CASE	:					List[Any]					=  [0.2_6_8_6_2_9_5_4, 0.2_6_1_3_0_2_5_8, 0.2_7_5_7_7_7_1_1]


'''simple docstring'''




from __future__ import annotations

from collections.abc import Generator

def      UpperCamelCase_							( _UpperCAmelCase  :				int   )   ->   Generator[int, None, None]:


       """simple docstring"""







       if not isinstance(_UpperCAmelCase      ,     _UpperCAmelCase   ) or n < 1:
              raise Exception("Sequence only defined for positive integers"   )

       yield n
       while n != 1:
              if n % 2 == 0:
                     n //= 2
              else:
                     _UpperCAmelCase					:  Optional[Any]											=   3 * n + 1
              yield n

def      UpperCamelCase_							( )   ->   Any:


       """simple docstring"""







       _UpperCAmelCase					:  str											=   43
       _UpperCAmelCase					:  Optional[int]											=   tuple(collatz_sequence(_UpperCAmelCase   )   )
       print(_UpperCAmelCase   )
       print(F"""Collatz sequence from {n} took {len(_UpperCAmelCase   )} steps."""   )


if __name__ == "__main__":
  main()

