3 ms·
My first inclination was to write a solver :) https://gist.github.com/nickponline/9a3fb1ee5333c52ed195625ea17c15b2 https://gist.github.com/nickponline/9a3fb1ee
by nickponline 5y ago
My first inclination was to write a solver :)
https://gist.github.com/nickponline/9a3fb1ee5333c52ed195625ea17c15b2 https://gist.github.com/nickponline/9a3fb1ee5333c52ed195625e...
- snk 5y agoNice 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 5y agoN = 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)