Skip to content

Commit

Permalink
add euler041 solution
Browse files Browse the repository at this point in the history
  • Loading branch information
kailanefelix committed Sep 27, 2021
1 parent d9b48ee commit 1fb5a1b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions euler0XX/euler041.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from itertools import permutations
from primality import is_prime

digits = '987654321'

for n in range(9):
for permutation in permutations(digits[n:]):
number = int(''.join(permutation))
if is_prime(number):
print(number)
break

else:
continue

break

0 comments on commit 1fb5a1b

Please sign in to comment.