#!/usr/bin/env python import eulerutils as eu productsDict = {} products = set() for x in range(1, 10000): for y in range(x, 100000): number = int(str("%d%d%d" % (x, y, x*y))) key = "%d*%d=%d" % (x, y, x*y) if number < 1000000000: if number > 123456788 and eu.isPandigital(number): productsDict[key] = x*y products.add(x*y) else: break print products print sum(products) print productsDict
#print string[-10:] a = 7540113804746346429 b = 12200160415121876738 for x in range(94, 1000000): cur = a + b a = b b = cur #print "%d = %d" % (x, cur) asString = str(cur) first9 = int(asString[0:9]) last9 = int(asString[-9:]) if(eu.isPandigital(last9)): print "Found where end is pandigital: %d count=%d first9=%d" % (last9, x, first9) if eu.isPandigital(first9): print "Found matching pandigitals %d and %d. Count=%d" % (first9, last9, x) break #count = 0 #for fib in fiblist: # count = count + 1 # if(fib > 100000000000000000000): # asString = str(fib) # first9 = int(asString[0:9]) # last9 = int(asString[-9:]) # #if count > 539 and count < 543:
#string = "abcdefghijklmnopqrstuvwxyz" #print string[0:10] #print string[-10:] a = 7540113804746346429 b = 12200160415121876738 for x in range(94, 1000000): cur = a + b a = b b = cur #print "%d = %d" % (x, cur) asString = str(cur) first9 = int(asString[0:9]) last9 = int(asString[-9:]) if (eu.isPandigital(last9)): print "Found where end is pandigital: %d count=%d first9=%d" % ( last9, x, first9) if eu.isPandigital(first9): print "Found matching pandigitals %d and %d. Count=%d" % (first9, last9, x) break #count = 0 #for fib in fiblist: # count = count + 1 # if(fib > 100000000000000000000): # asString = str(fib) # first9 = int(asString[0:9]) # last9 = int(asString[-9:]) # #if count > 539 and count < 543: