Skip to content

Instantly share code, notes, and snippets.

@yct72
yct72 / main.py
Last active June 7, 2022 07:16
Simple implementation of Miller-Rabin primality test
from miller_rabin import *
## find the largest 1024-bit prime
## naive
n = 2 ** 1024 - 1
s = 40
for i in range(n, 2, -2):
if miller_rabin(i, 40):
print(f"{i} is the largest prime.")