def solve(): for prime in generate_primes(): for c in str(prime): mask = str(prime).replace(c, '*') family = prime_star_variations(mask) if len(family) == 8: return min(family)
def primes_between(start, end): lst = [] for prime in generate_primes(): if prime > end: return lst if prime >= start: lst.append(prime)
def solve(): largest = 0 for prime in generate_primes(): if is_pandigital(prime): largest = prime if prime > 10000000: return largest
def solve(): numbers = [] for prime in generate_primes(): if is_truncatable_prime(prime): numbers.append(prime) if len(numbers) >= 11: break return sum(numbers)
def circular_primes_below(limit): circular_primes = [] for prime in generate_primes(): p = is_circular_prime(prime) if prime > limit: break if p: circular_primes += p return set(circular_primes)
def has_problem_property(n): s = str(n) if len(s) == 9: s = '0' + s i = 1 for prime in generate_primes(): if prime > 17: return True part = int(s[i:i + 3]) if not part % prime == 0: return False i += 1
def solve(): i = 7.0 while True: i += 2.0 if is_prime(i): continue for prime in generate_primes(): if prime > i: return i r = i - prime if not r % 2 == 0: continue r = math.sqrt(r / 2.0) if r == math.floor(r): break pass
def prime_at(nr): prime_nr = 1 for prime in generate_primes(): if prime_nr == nr: return prime prime_nr += 1
from problem003 import generate_primes if __name__ == '__main__': primes = generate_primes(2000000) total = 0 for prime in primes: total += prime print(total)