Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 22 lines (21 sloc) 0.474 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
"""
----
Sigma > 9 or 8 is divisable by 7
----
"""
from itertools import permutations
from math import sqrt
np = '245680' # not primes
l = [ int("7"+"".join(i)) for i in permutations('654321') if i[-1] not in np] #needs maximum first

for i in l:
    j = 3
    isprime = True
    while j <= sqrt(i):
        if i%j == 0:
            isprime = False
            break
        else:
            j += 2
    if isprime == True:
        print i
        break
Something went wrong with that request. Please try again.