[WIP] too slow

This commit is contained in:
David Doblas Jiménez 2021-12-02 22:03:52 +01:00
parent 6c0a3d967f
commit 037f4c0f8d

View File

@ -1,5 +1,3 @@
testing
#!/usr/bin/env python3
"""
Created on 13 Oct 2021
@ -11,7 +9,8 @@ Solution for problem 60 of Project Euler
https://projecteuler.net/problem=60
"""
from utils import timeit
from itertools import permutations
from utils import timeit, list_primes
@timeit("Problem 60")
@ -27,7 +26,17 @@ def compute():
concatenate to produce another prime.
"""
# Your code goes here
primes_list = list_primes(10_000)
for nums in permutations(primes_list, 5):
for n1, n2 in permutations(nums, 2):
if int(str(n1) + str(n2)) not in primes_list:
break
primes = sum(nums)
print(nums)
# break
return primes
if __name__ == "__main__":