Large Primes, which are needed especially for RSA, are found by
randomly choosing numbers and then testing them.
The Prime theorem, a famous result of number theory, says that
he amount of all primes below N is approximately
N / ln N.
So if p is chosen at random the likelikood for
p being prime is approx. 1 / ln p.
For any given number the applet finds the next bigger
prime (or the same number, via isProbablePrime()):