Beispiel #1
0
def largest_concated_pandigital_product(largest=0):
    for x in xrange(10000, 9000, -1):
        for i in xrange(3):
            c = concated_product(x, i)
            if pandigital(c):
                if c > largest:
                    largest = c
    return largest
Beispiel #2
0
def problem_32():
    p = set()
    for x in xrange(2, 100):
        b = 1234 if x < 10 else 123
        for y in xrange(b, 10000/x):
            if pandigital(str(x)+str(y)+str(x*y)):
                p.add(x*y)
    return sum(p)
Beispiel #3
0
def try_number(num):
    concat = ""
    for p in range(1, 10):
        concat += str(num * p)
        if digit_repeats(concat):
            return -1
        if pandigital(concat):
            return int(concat)
    return -1
#!/usr/bin/python

import euler

pan = ""
maxpan = 0

for i in range(2, 10):
	for j in range(1, 10000):
		pan = ""
		for k in range(1, i+1):
			pan += str(k*j)
			if len(pan) == 9 and euler.pandigital(pan[:9]):
				maxpan = max(maxpan, int(pan))

print maxpan