Exemplo n.º 1
0
 def passthru(self):
     candidate=2
     while True:
         if not p.listHasFactor(self.curPrimes, candidate):
             yield candidate
             self.curPrimes.append(candidate)
         candidate+=1
Exemplo n.º 2
0
def consecPerms(x):
    l=range(1,x+1)
    pIterator=Perm(l)
    return pIterator

def lToInt(intList):
    s=0
    tensPow=len(intList)-1
    factor=math.pow(10,tensPow)
    for x in intList:
        s+=x*factor
        factor /= 10
    return int(s)



r=range(1,10)
r.sort(reverse=1)
for x in r:
    print x
    curL=consecPerms(x)
    for y in curL:
        intified=lToInt(y)
        if not p.listHasFactor(relevantPrimes, intified):
            print y
##        else:
##            print p.listHasFactor(relevantPrimes, x)
##            print x
##            print ""