'''simple docstring'''




def      UpperCamelCase_							( _UpperCAmelCase  :				list      ,     _UpperCAmelCase  :				int   )   ->   int:


       """simple docstring"""







       for index, item in enumerate(_UpperCAmelCase   ):
              if item == target:
                     return index
       return -1

def      UpperCamelCase_							( _UpperCAmelCase  :				list      ,     _UpperCAmelCase  :				int      ,     _UpperCAmelCase  :				int      ,     _UpperCAmelCase  :				int   )   ->   int:


       """simple docstring"""







       if not (0 <= high < len(_UpperCAmelCase   ) and 0 <= low < len(_UpperCAmelCase   )):
              raise Exception("Invalid upper or lower bound!"   )
       if high < low:
              return -1
       if sequence[low] == target:
              return low
       if sequence[high] == target:
              return high
       return rec_linear_search(_UpperCAmelCase      ,     low + 1      ,     high - 1      ,     _UpperCAmelCase   )


if __name__ == "__main__":
  __SCREAMING_SNAKE_CASE	:					List[str]					=  input("""Enter numbers separated by comma:\n""").strip()
  __SCREAMING_SNAKE_CASE	:					Optional[Any]					=  [int(item.strip()) for item in user_input.split(""",""")]

  __SCREAMING_SNAKE_CASE	:					List[str]					=  int(input("""Enter a single number to be found in the list:\n""").strip())
  __SCREAMING_SNAKE_CASE	:					str					=  linear_search(sequence, target)
  if result != -1:
    print(F'linear_search({sequence}, {target}) = {result}')
  else:
    print(F'{target} was not found in {sequence}')


'''simple docstring'''




from itertools import compress, repeat
from math import ceil, sqrt

def      UpperCamelCase_							( _UpperCAmelCase  :				int   )   ->   list[int]:


       """simple docstring"""







       if num <= 2:
              return []
       if num == 3:
              return [2]

       # Odd sieve for numbers in range [3, num - 1]
       _UpperCAmelCase					:  Optional[int]											=   bytearray(b"\x01"   ) * ((num >> 1) - 1)

       for i in range(3      ,     int(sqrt(_UpperCAmelCase   )   ) + 1      ,     2   ):
              if sieve[(i >> 1) - 1]:
                     _UpperCAmelCase					:  List[Any]											=   i**2
                     _UpperCAmelCase					:  Optional[int]											=   repeat(
                         0      ,     ceil((num - i_squared) / (i << 1)   )   )

       return [2] + list(compress(range(3      ,     _UpperCAmelCase      ,     2   )      ,     _UpperCAmelCase   )   )


if __name__ == "__main__":
  import doctest

  doctest.testmod()

