summaryrefslogtreecommitdiff
path: root/misc/lab1_gen_tex.py
diff options
context:
space:
mode:
Diffstat (limited to 'misc/lab1_gen_tex.py')
-rw-r--r--misc/lab1_gen_tex.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/misc/lab1_gen_tex.py b/misc/lab1_gen_tex.py
new file mode 100644
index 0000000..8c47540
--- /dev/null
+++ b/misc/lab1_gen_tex.py
@@ -0,0 +1,10 @@
+last = 0
+for i in range(1, 29):
+ if last != 0:
+ nx = (last * 2) % 29
+ print("2^{{{0}}} &= {1} \\pmod {{29}} = {2} \\\\".format(i, f"{last} \\cdot 2", nx))
+ last = nx
+ else:
+ print("2^{{{0}}} &= {1} \\pmod {{29}} = {2} \\\\".format(i, 2, 2))
+ last = 2
+