aboutsummaryrefslogtreecommitdiff
path: root/challenge-149/abigail/python/ch-2.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-149/abigail/python/ch-2.py')
-rw-r--r--challenge-149/abigail/python/ch-2.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/challenge-149/abigail/python/ch-2.py b/challenge-149/abigail/python/ch-2.py
new file mode 100644
index 0000000000..68b490cfa4
--- /dev/null
+++ b/challenge-149/abigail/python/ch-2.py
@@ -0,0 +1,42 @@
+#!/usr/local/bin/python3
+
+#
+# See https://theweeklychallenge.org/blog/perl-weekly-challenge-149
+#
+
+#
+# Run as: python ch-2.py < input-file
+#
+
+A287298 = {}
+
+A287298 [ 2] = "1"
+A287298 [ 3] = "1"
+A287298 [ 4] = "3201"
+A287298 [ 5] = "4301"
+A287298 [ 6] = "452013"
+A287298 [ 7] = "6250341"
+A287298 [ 8] = "47302651"
+A287298 [ 9] = "823146570"
+A287298 [10] = "9814072356"
+A287298 [11] = "A8701245369"
+A287298 [12] = "B8750A649321"
+A287298 [13] = "CBA504216873"
+A287298 [14] = "DC71B30685A924"
+A287298 [15] = "EDAC93B24658701"
+A287298 [16] = "FED5B39A42706C81"
+A287298 [17] = "GFED5A31C6B79802"
+A287298 [18] = "HGF80ADC53712EB649"
+A287298 [19] = "IHGFD3408C6E715A2B9"
+A287298 [20] = "JIHG03DAC457BFE96281"
+A287298 [22] = "LKJIG5D14B9032FHAC867E"
+
+
+import fileinput
+
+for n in fileinput . input ():
+ n = int (n)
+ if n in A287298:
+ print (A287298 [n])
+ else:
+ print ("Too hard to calculate")