예제 #1
0
def run():
    primes = [p for p in euler_util.primes(17)]

    sum = 0
    for c in euler_util.combos(range(10)):
        if c[0] == 0:
            continue
        if curious(c, primes):
            # print c
            sum += euler_util.undigits(c)
예제 #2
0
def run():
    primes = [p for p in euler_util.primes(int(math.ceil(math.sqrt(987654321))))]

    max = 0
    toks = []
    for i in [1,2,3,4,5,6,7,8,9]:
        toks.append(i)
        for c in euler_util.combos(toks):
            x = euler_util.undigits(c)
            if is_prime(x, primes) and x > max:
                max = x