def test_primality(n, rounds = 50): if mod(n,2)==0: return False for r in range(rounds): v = randint(1,n-1) if mod(jacobi_symbol(v,n),n)!=power_mod(v,floor((n-1)/2),n): return False return True # You too can create a really big prime n = 935839458723945 if mod(n,2)==1: n=n+1 while not test_primality(n): n = n+2 n