'''simple docstring'''




def      UpperCamelCase_							( _UpperCAmelCase  :				int = 20   ):


       """simple docstring"""







       try:
              _UpperCAmelCase					:  List[str]											=   int(SCREAMING_SNAKE_CASE_   )
       except (TypeError, ValueError):
              raise TypeError("Parameter n must be int or castable to int."   )
       if n <= 0:
              raise ValueError("Parameter n must be greater than or equal to one."   )
       _UpperCAmelCase					:  Union[str, Any]											=   0
       while 1:
              i += n * (n - 1)
              _UpperCAmelCase					:  List[str]											=   0
              for j in range(2      ,     SCREAMING_SNAKE_CASE_   ):
                     if i % j != 0:
                            _UpperCAmelCase					:  str											=   1
                            break
              if nfound == 0:
                     if i == 0:
                            _UpperCAmelCase					:  Optional[Any]											=   1
                     return i
       return None


if __name__ == "__main__":
  print(F'{solution() = }')


'''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()

