



'''simple docstring'''



import math
from collections.abc import Iterator
from itertools import takewhile
def 					UpperCAmelCase   (						A  :				int				):

							if 1 < number < 4:
														# 2 and 3 are primes
														return True
							elif number < 2 or number % 2 == 0 or number % 3 == 0:
														# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
														return False

							# All primes number are in format of 6k +/- 1
							for i in range(5					,		int(math.sqrt(A				) + 1				)					,		6				):
														if number % i == 0 or number % (i + 2) == 0:
																					return False
							return True
def 					UpperCAmelCase   (						):
							SCREAMING_SNAKE_CASE					:      Optional[Any]     					=			2
							while True:
														if is_prime(A				):
																					yield num
														num += 1
def 					UpperCAmelCase   (						A  :				int = 2000000				):
							return sum(takewhile(lambda A				: x < n					,		prime_generator()				)				)


if __name__ == "__main__":
							print(f'{solution() = }')









'''simple docstring'''



import os


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_doctest_list.py
lowerCAmelCase_     :       Optional[Any]								=						'.'


if __name__ == "__main__":
							lowerCAmelCase_     :       Optional[Any]								=						os.path.join(REPO_PATH, 'utils/documentation_tests.txt')
							lowerCAmelCase_     :       Dict								=						[]
							lowerCAmelCase_     :       Any								=						[]
							with open(doctest_file_path) as fp:
														for line in fp:
																					lowerCAmelCase_     :       List[str]								=						line.strip()
																					lowerCAmelCase_     :       Optional[Any]								=						os.path.join(REPO_PATH, line)
																					if not (os.path.isfile(path) or os.path.isdir(path)):
																												non_existent_paths.append(line)
																					all_paths.append(path)
							if len(non_existent_paths) > 0:
														lowerCAmelCase_     :       Dict								=						'\n'.join(non_existent_paths)
														raise ValueError(f'`utils/documentation_tests.txt` contains non-existent paths:\n{non_existent_paths}')
							if all_paths != sorted(all_paths):
														raise ValueError('Files in `utils/documentation_tests.txt` are not in alphabetical order.')




