summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Guschin <guschin.drew@gmail.com>2022-11-13 11:47:17 +0400
committerAndrew Guschin <guschin.drew@gmail.com>2022-11-13 11:47:17 +0400
commit31ede18fb5752b4524868be845b88d26bda13754 (patch)
treeffc7be3e9ad01eee3c31deaacdc9ec0c5059e20d
parent2490844ed0b6e8fb64af0b8a18cc2bdfd87690f5 (diff)
Добавлены дополнительные файлы
-rw-r--r--misc/lab1-md.pdfbin0 -> 93784 bytes
-rw-r--r--misc/lab1_gen_tex.py10
-rw-r--r--misc/lab3_gen_tex.py19
3 files changed, 29 insertions, 0 deletions
diff --git a/misc/lab1-md.pdf b/misc/lab1-md.pdf
new file mode 100644
index 0000000..bdd926c
--- /dev/null
+++ b/misc/lab1-md.pdf
Binary files 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)