about summary refs log tree commit diff
path: root/THT/B/QG-2016/trigrid.py
diff options
context:
space:
mode:
Diffstat (limited to 'THT/B/QG-2016/trigrid.py')
-rwxr-xr-xTHT/B/QG-2016/trigrid.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/THT/B/QG-2016/trigrid.py b/THT/B/QG-2016/trigrid.py
new file mode 100755
index 0000000..ea33d07
--- /dev/null
+++ b/THT/B/QG-2016/trigrid.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+
+a = (4, 3, 5, 6, 111, 222, 3333, 4444, 55555, 666666, 7777777, 88888888,
+     999999999, 123456789123456789, 1000000000000000000)
+
+t = lambda n: n * (n + 2) * (n * 2 + 1) // 8 % 2016
+
+with open('TRIGRID.TXT', 'w') as f:
+    for i in a:
+        f.write("{}\n".format(t(i)))