
def 	_a  (					__SCREAMING_SNAKE_CASE					:  list    ):






  """simple docstring"""




  if not isinstance(lowerCamelCase_		,				lowerCamelCase_    ):
    raise ValueError('Input series is not valid, valid series - [2, 4, 8]'    )
  if len(lowerCamelCase_    ) == 0:
    raise ValueError('Input list must be a non empty list'    )
  if len(lowerCamelCase_    ) == 1:
    return True
  try:
    _lowerCAmelCase						=		series[1] / series[0]
    for index in range(len(lowerCamelCase_    ) - 1    ):
      if series[index + 1] / series[index] != common_ratio:
        return False
  except ZeroDivisionError:
    return False
  return True



def 	_a  (					__SCREAMING_SNAKE_CASE					:  list    ):






  """simple docstring"""




  if not isinstance(lowerCamelCase_		,				lowerCamelCase_    ):
    raise ValueError('Input series is not valid, valid series - [2, 4, 8]'    )
  if len(lowerCamelCase_    ) == 0:
    raise ValueError('Input list must be a non empty list'    )
  _lowerCAmelCase						=		1
  for value in series:
    answer *= value
  return pow(lowerCamelCase_		,				1 / len(lowerCamelCase_    )    )


if __name__ == "__main__":
       import doctest

       doctest.testmod()




"""simple docstring"""






from __future__ import annotations

from collections.abc import Generator


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

				yield n
				while n != 1:
								if n % 2 == 0:
												n //= 2
								else:
												SCREAMING_SNAKE_CASE__  				=					3 * n + 1
								yield n


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


if __name__ == "__main__":
	main()
