summaryrefslogtreecommitdiff
path: root/028.py
diff options
context:
space:
mode:
Diffstat (limited to '028.py')
-rw-r--r--028.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/028.py b/028.py
new file mode 100644
index 0000000..3ec1ff5
--- /dev/null
+++ b/028.py
@@ -0,0 +1,13 @@
+
+width = 1001
+max_level = (width-1)/2
+
+last = sum = 1
+
+for level in range(1, max_level+1):
+ add = 2*level
+ sum += (last+add) + (last+2*add) + (last+3*add) + (last+4*add)
+ last = last+4*add
+
+print sum
+