Example #1
0
def run():
    result = 0;

    for i in eulermath.permutations(list("1234567890")):
        str_i = eulersupport.list_to_str(i);
        int_i = int(str_i);
        if(eulermath.is_strictly_pandigital(int_i, 0, 9) and f(int_i)):
            print str_i;
            result += 1;

    eulersupport.write_output(result);
Example #2
0
def run():
    result = 0

    for i in eulermath.permutations(list("1234567890")):
        str_i = eulersupport.list_to_str(i)
        int_i = int(str_i)
        if (eulermath.is_strictly_pandigital(int_i, 0, 9) and f(int_i)):
            print str_i
            result += 1

    eulersupport.write_output(result)
Example #3
0
def run():
    list_of_pandigitals = [];
    upperbound = 999999 + 1;

    for a in xrange(2, upperbound):
        for b in xrange(2, a):
            #Create a concatenated product of a by (1...n)
            con_prod = concatenated_product(a, b);
            #We reach a number that is bigger than 9 digits.
            #has no meaning to keeping searching because it'll not
            #be a pandigital number.
            if(len(con_prod) > 9): break;


            if(eulermath.is_strictly_pandigital(con_prod, 1, 9)):
                list_of_pandigitals += [con_prod];

    list_of_pandigitals.sort();
    result = list_of_pandigitals[len(list_of_pandigitals)-1];

    #Print the result.
    eulersupport.write_output(result);
def run():
    multiplicand = 1
    products_set = set()
    while (True):
        for multiplier in range(1, multiplicand):
            product = multiplicand * multiplier

            #Build the whole number.
            n_concat = str(multiplicand) + str(multiplier) + str(product)

            #Check if the number is pandigital.
            if (eulermath.is_strictly_pandigital(n_concat, 1, 9)):
                products_set.add(product)
                print str(multiplicand) + " * " + str(
                    multiplier) + " = " + str(product)
                print products_set

            if (product > 987654321):  #Max number that can be pandigital 1, 9
                #Print the result.
                eulersupport.write_output(sum(products_set))
                return

        multiplicand += 1