17 lines
448 B
Python
17 lines
448 B
Python
|
|
from tools import number_theory
|
|
|
|
def same(x, y):
|
|
return sorted(str(x)) == sorted(str(y))
|
|
|
|
def search(limit):
|
|
prime = list(filter(lambda x: x > 1487, number_theory.make_prime(limit)))
|
|
for i, pi in enumerate(prime):
|
|
for pj in prime[i + 1:]:
|
|
if same(pi, pj):
|
|
pn = 2 * pj - pi
|
|
if same(pn, pi) and pn in prime:
|
|
return str(pi) + str(pj) + str(pn)
|
|
|
|
print(search(10000))
|