From 31ede18fb5752b4524868be845b88d26bda13754 Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Sun, 13 Nov 2022 11:47:17 +0400 Subject: =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B?= =?UTF-8?q?=20=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D1=8B=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- misc/lab1-md.pdf | Bin 0 -> 93784 bytes misc/lab1_gen_tex.py | 10 ++++++++++ misc/lab3_gen_tex.py | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 misc/lab1-md.pdf create mode 100644 misc/lab1_gen_tex.py create mode 100644 misc/lab3_gen_tex.py (limited to 'misc') diff --git a/misc/lab1-md.pdf b/misc/lab1-md.pdf new file mode 100644 index 0000000..bdd926c Binary files /dev/null and b/misc/lab1-md.pdf differ 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 + diff --git a/misc/lab3_gen_tex.py b/misc/lab3_gen_tex.py new file mode 100644 index 0000000..90040ea --- /dev/null +++ b/misc/lab3_gen_tex.py @@ -0,0 +1,19 @@ +from math import floor, sqrt + +n = 21894583143407671 + +def f(n, k, d): + return (floor(sqrt(4 * k * n)) + d) ** 2 - 4 * k * n + +def is_square(n): + k = int(sqrt(n)) + return n == k * k + +for k in range(1, floor(n ** (1/3))+ 1): + d_max = int(floor(n ** (1/6) / (4 * sqrt(k)))) + for d in range(0, d_max + 2): + q = f(n, k, d) + if q >= 0 and is_square(q): + print(q) + print("d ", k, d) + exit(1) -- cgit v1.2.3