summaryrefslogtreecommitdiff
path: root/misc/lab1_gen_tex.py
blob: 8c4754058d25946d827f1b9cf63030990ef9ff17 (plain)
1
2
3
4
5
6
7
8
9
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