aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/denom.lean12
-rw-r--r--src/denom.py4
2 files changed, 12 insertions, 4 deletions
diff --git a/src/denom.lean b/src/denom.lean
new file mode 100644
index 0000000..93e2692
--- /dev/null
+++ b/src/denom.lean
@@ -0,0 +1,12 @@
+# x = 1 - 0.9772532922866427
+# for i in range(1, 10000):
+# if abs(x * i - round(x * i)) < 1e-4:
+# print(i, x * i)
+
+def x := 1 - 0.9772532922866427
+
+def N := 10000
+
+def A := (List.range N).map λ a => a + 1
+
+#eval A.filter λ a => Float.abs ((x * Float.ofNat a) - Float.round (x * Float.ofNat a)) < 1e-4
diff --git a/src/denom.py b/src/denom.py
deleted file mode 100644
index b18db2d..0000000
--- a/src/denom.py
+++ /dev/null
@@ -1,4 +0,0 @@
-x = 1 - 0.9772532922866427
-for i in range(1, 10000):
- if abs(x * i - round(x * i)) < 1e-4:
- print(i, x * i)