[Solved] Lehmann Test for prime numbers [closed]


Let’s call PP your Potential Prime.

  • (1) Choose a random number a less than PP.
  • (2) Calculate a^(p-1)/2 mod PP.
  • (3) If a^(PP-1)/2 /= 1 or -1 (mod PP), then PP is not prime.
  • (4) If a^(PP-1)/2 = 1 or -1 (mod PP), then the probability that PP is not prime is less than 50%.

1

solved Lehmann Test for prime numbers [closed]