top | item 30027835

(no title)

nickponline | 4 years ago

My first inclination was to write a solver :)

https://gist.github.com/nickponline/9a3fb1ee5333c52ed195625e...

discuss

order

snk|4 years ago

Nice solver! I did optimize the sieve a little...

N = 100000 primes = [False, True] * N // 2 for i in range(3, N, 2):

    if primes[i]:
        k = i ** 2
        while k < N:
            primes[k] = False
            k += i * 2

snk|4 years ago

N = 100000 prime = [False, True] * (N // 2) primes = [] for i in range(3, N, 2):

    if prime[i]:
        primes.append(i)
        k = i ** 2
        while k < N:
            prime[k] = False
            k += i * 2
useful = [ str(i) for i in primes ]

# Enter your clues

for i in useful: if i[0] == '6' and ('3' in i) and len(str(i)) == 5: print(i)