-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path038.py
More file actions
48 lines (46 loc) · 1.11 KB
/
Copy path038.py
File metadata and controls
48 lines (46 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
def isPandigital(strN):
Ln = [c for c in strN]
Ln.sort()
if Ln == ['1', '2', '3', '4', '5', '6', '7', '8', '9']:
return True
return False
listPans=[]
listMultiplier=[]
#dont know if these limits are ok
i=9
while i<9999:
n=2
while n<999:
j=1
strProd=''
while j<n:
prod=j*i
strProd += str(prod)
j+=1
if len(strProd)>9:
break
#print i, n, strProd
if isPandigital(strProd):
listPans.append(prod)
listMultiplier.append(i)
print "Pandigital", i, j, strProd
n+=1
i+=1
#output:
#Pandigital 9 6 918273645
#Pandigital 192 4 192384576
#Pandigital 219 4 219438657
#Pandigital 273 4 273546819
#Pandigital 327 4 327654981
#Pandigital 6729 3 672913458
#Pandigital 6792 3 679213584
#Pandigital 6927 3 692713854
#Pandigital 7269 3 726914538
#Pandigital 7293 3 729314586
#Pandigital 7329 3 732914658
#Pandigital 7692 3 769215384
#Pandigital 7923 3 792315846
#Pandigital 7932 3 793215864
#Pandigital 9267 3 926718534
#Pandigital 9273 3 927318546
#Pandigital 9327 3 932718654