diff options
Diffstat (limited to '043.py')
| -rw-r--r-- | 043.py | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -0,0 +1,35 @@ +from common import pandigital + + +def check_number(i): + x = str(i) + if int(x[1:4]) & 1 != 0: + return False + if int(x[2:5]) % 3 != 0: + return False + if int(x[3:6]) % 5 != 0: + return False + if int(x[4:7]) % 7 != 0: + return False + if int(x[5:8]) % 11 != 0: + return False + if int(x[6:9]) % 13 != 0: + return False + if int(x[7:10]) % 17 != 0: + return False + return True + + +numbers = pandigital(0, 9).numbers(11) + +result = 0 + +for i in numbers: + if i < 1000000000: + continue + + if check_number(i): + result += i + +print result + |
