Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,30 @@
import util.rnd
def isProbablyPrimeMillerRabin( n, k ) =
d = n - 1
s = 0
while 2|d
s++
d /= 2
repeat k
a = rnd( 2, n )
x = a^d mod n
if x == 1 or x == n - 1 then continue
repeat s - 1
x = x^2 mod n
if x == 1 then return false
if x == n - 1 then break
else
return false
true
for i <- 3..100
if isProbablyPrimeMillerRabin( i, 5 )
println( i )