f  =  x/Log [x]

fx  =  D[f, x]

steigung   =  N[fx  /.  x  ->  2^1024]

1 / steigung

2^32 +  1

FactorInteger [%]

641 * 6700417

n  = 
      19

n - 1

18 /2

Mod [3^9,  n]

n =  111

n  -  1

110 /2

Mod [3^55,  n]

n  =  2^32  +  1

n  -  1

n1  =  (n -  1)/16

Table [PowerMod [3, (2^r),  n],  {r, 0, 31}]

n  -  1

PowerMod [3, n, n]

<<  demo1.m

Table [
      HasPassedMillerRabin [2^512  +  1, 1],  {i, 100}]

n  =  2^1024  +  645;
While [ Not [HasPassedMillerRabin [n, 4]],  
      n  =  n  +  2]

n

n -  2^1024

HasPassedMillerRabin [2^1024  +  1081, 50]