def is_prime(n):
"""Check if a number is a prime number."""
if n <= 1:
return False
if n <= 3:
return True
if n % 2 == 0 or n % 3 == 0:
return False
i = 5
while i * i <= n:
if n % i == 0 or n % (i + 2) == 0:
return False
i += 6
return True
def sum_of_primes(limit):
"""Calculate the sum of the first 'limit' prime numbers."""
prime_count = 0
num = 2
prime_sum = 0
while prime_count < limit:
if is_prime(num):
prime_sum += num
prime_count += 1
num += 1
return prime_sum
# Calculate the sum of the first 200 prime numbers
sum_200_primes = sum_of_primes(200)
print("The sum of the first 200 prime numbers is:", sum_200_primes)
ZGVmIGlzX3ByaW1lKG4pOgogICAgIiIiQ2hlY2sgaWYgYSBudW1iZXIgaXMgYSBwcmltZSBudW1iZXIuIiIiCiAgICBpZiBuIDw9IDE6CiAgICAgICAgcmV0dXJuIEZhbHNlCiAgICBpZiBuIDw9IDM6CiAgICAgICAgcmV0dXJuIFRydWUKICAgIGlmIG4gJSAyID09IDAgb3IgbiAlIDMgPT0gMDoKICAgICAgICByZXR1cm4gRmFsc2UKICAgIGkgPSA1CiAgICB3aGlsZSBpICogaSA8PSBuOgogICAgICAgIGlmIG4gJSBpID09IDAgb3IgbiAlIChpICsgMikgPT0gMDoKICAgICAgICAgICAgcmV0dXJuIEZhbHNlCiAgICAgICAgaSArPSA2CiAgICByZXR1cm4gVHJ1ZQoKZGVmIHN1bV9vZl9wcmltZXMobGltaXQpOgogICAgIiIiQ2FsY3VsYXRlIHRoZSBzdW0gb2YgdGhlIGZpcnN0ICdsaW1pdCcgcHJpbWUgbnVtYmVycy4iIiIKICAgIHByaW1lX2NvdW50ID0gMAogICAgbnVtID0gMgogICAgcHJpbWVfc3VtID0gMAogICAgd2hpbGUgcHJpbWVfY291bnQgPCBsaW1pdDoKICAgICAgICBpZiBpc19wcmltZShudW0pOgogICAgICAgICAgICBwcmltZV9zdW0gKz0gbnVtCiAgICAgICAgICAgIHByaW1lX2NvdW50ICs9IDEKICAgICAgICBudW0gKz0gMQogICAgcmV0dXJuIHByaW1lX3N1bQoKIyBDYWxjdWxhdGUgdGhlIHN1bSBvZiB0aGUgZmlyc3QgMjAwIHByaW1lIG51bWJlcnMKc3VtXzIwMF9wcmltZXMgPSBzdW1fb2ZfcHJpbWVzKDIwMCkKcHJpbnQoIlRoZSBzdW0gb2YgdGhlIGZpcnN0IDIwMCBwcmltZSBudW1iZXJzIGlzOiIsIHN1bV8yMDBfcHJpbWVzKQ==