repeating random primary test many times makes the result PROBABLY right. a^(p-1) mod p = 1 is always satisfied if p is prime. (a is a random number.) use the calculation for the test. the number of steps doesn't result in so many times but you can know if the number is PROBABLY prime or not.