Make FindLargeSafePrimes more general-purpose