ParentFull threadgeonnave·I assume the BigInteger library, which offers isPrime() and isProbablyPrime() functions, already does that kind of optimization.View on HN