






from __future__ import annotations

from collections.abc import Generator

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

		yield n
		while n != 1:
				if n % 2 == 0:
						n //= 2
				else:
						snake_case_ :							List[str]         =				3 * n + 1
				yield n

def    lowerCAmelCase__		(			):
		snake_case_ :							Optional[int]         =				43
		snake_case_ :							Union[str, Any]         =				tuple(collatz_sequence(_a			)			)
		print(_a			)
		print(F'''Collatz sequence from {n} took {len(_a			)} steps.'''			)


if __name__ == "__main__":
							main()








def    lowerCAmelCase__		(			_a				:	int			):
		if not isinstance(_a     ,					_a			):
				snake_case_ :							Optional[int]         =				F'''Input value of [number={number}] must be an integer'''
				raise TypeError(_a			)
		if number < 1:
				raise ValueError("Input must be a positive integer"			)
		return number * (2 * number - 1)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
