


from __future__ import annotations

from collections.abc import Generator




def 			a_   (					SCREAMING_SNAKE_CASE__      :   List[str]  ):
       '''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:
                     _lowerCamelCase :	Optional[int]						=3 * n + 1
              yield n




def 			a_   (					):
       '''simple docstring'''





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


if __name__ == "__main__":
 main()






from __future__ import annotations

from collections.abc import Generator




def 			a_   (					SCREAMING_SNAKE_CASE__      :   int  ):
       '''simple docstring'''





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

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




def 			a_   (					):
       '''simple docstring'''





       _lowerCamelCase :	Dict						=43
       _lowerCamelCase :	Dict						=tuple(collatz_sequence(SCREAMING_SNAKE_CASE__  )  )
       print(SCREAMING_SNAKE_CASE__  )
       print(F'''Collatz sequence from {n} took {len(SCREAMING_SNAKE_CASE__  )} steps.'''  )


if __name__ == "__main__":
 main()


