Factory methods for Prime, SafePrime, TwoPrimes