'''simple docstring'''


from __future__ import annotations

from collections.abc import Generator


def 					_lowerCamelCase    (      lowerCamelCase_					:							int   ):



     """simple docstring"""





     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:
               UpperCAmelCase_							:   List[str]   =      3 * n + 1
          yield n


def 					_lowerCamelCase    (      ):



     """simple docstring"""





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


if __name__ == "__main__":
 main()














from __future__ import annotations

def    lowerCAmelCase__		(			_a				:	list[int]     ,					_a				:	int			):
		snake_case_       ,				snake_case_ :							Tuple         =				0, len(_a			) - 1
		while start_ind <= end_ind:
				if array[start_ind] == search_item:
						return start_ind
				elif array[end_ind] == search_item:
						return end_ind
				else:
						start_ind += 1
						end_ind -= 1
    # returns -1 if search_item is not found in array
		return -1


if __name__ == "__main__":
							print(double_linear_search(list(range(1_00)), 40))
