


def 							__lowercase     (				__lowerCAmelCase							:       int     ):

							if num <= 0:
														raise ValueError('Input must be a positive integer'     )

							a__    =  [True] * (num + 1)

							a__    =  2
							while p * p <= num:
														if primes[p]:
																					for i in range(p * p      ,					num + 1      ,					__lowerCAmelCase     ):
																												a__    =  False
														p += 1

							return [prime for prime in range(2      ,					num + 1     ) if primes[prime]]


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						snake_case							: int      =   int(input('''Enter a positive integer: ''').strip())
						print(prime_sieve_eratosthenes(user_num))








from __future__ import annotations






def 							__lowercase     (				__lowerCAmelCase							:       list[int]     ):  # This function is recursive
							a__    =  len(__lowerCAmelCase     )
							# If the array contains only one element, we return it (it's the stop condition of
							# recursion)
							if array_length <= 1:
														return array
														# Else
							a__    =  array[0]
							a__    =  False
							a__    =  1
							a__    =  []
							while not is_found and i < array_length:
														if array[i] < pivot:
																					a__    =  True
																					a__    =  [element for element in array[i:] if element >= array[i]]
																					a__    =  longest_subsequence(__lowerCAmelCase     )
																					if len(__lowerCAmelCase     ) > len(__lowerCAmelCase     ):
																												a__    =  temp_array
														else:
																					i += 1

							a__    =  [element for element in array[1:] if element >= pivot]
							a__    =  [pivot, *longest_subsequence(__lowerCAmelCase     )]
							if len(__lowerCAmelCase     ) > len(__lowerCAmelCase     ):
														return temp_array
							else:
														return longest_subseq


if __name__ == "__main__":
						import doctest

						doctest.testmod()




