Beispiel #1
0
#!/usr/bin/python
import primes

p = primes.sieve_of_erastosthenes()
primes = []
while True:
    y = next(p)
    if y < 2000000:
        primes.append(y)
    else:
        break

print(sum(primes))
Beispiel #2
0
#!/usr/bin/python
import math
import primes
largest_prime = 0
for x in primes.sieve_of_erastosthenes():
    if x > math.sqrt(600851475143):
        break
    elif 600851475143 % x == 0:
        largest_prime = x

print(largest_prime)