From 95341b61b030c9e1290f3b326cb7ec584f543aea Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Sun, 31 Aug 2014 20:21:45 +0200 Subject: moved files to higher directory after split to new repository --- 043.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 043.py (limited to '043.py') diff --git a/043.py b/043.py new file mode 100644 index 0000000..2dd1db9 --- /dev/null +++ b/043.py @@ -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 + -- cgit v1.2.3