Esempio n. 1
0
File: p41.py Progetto: bwo/euler
def main():
    for i in range(9, 2, -1):
        digits = range(i,0,-1)
        pandigitals = permute(tuple(digits))
        for p in pandigitals:
            if p[-1] % 2 == 0: continue
            t = tonum(p)
            if isprime(t, primes):
                print t
                return
Esempio n. 2
0
File: p24.py Progetto: bwo/euler
#! /usr/bin/python

import eulertools, itertools
c=0
p = eulertools.permute((0,1,2,3,4,5,6,7,8,9))
while c < 999999:
    p.next()
    c+=1
print p.next()