Commons Math

org.apache.commons.math3.primes.Primes 是关于质数操作的工具类。

1. public static boolean isPrime(int n)
  判断 n 是否为质数。

2. public static int nextPrime(int n)
  返回大于 n 的最小质数。

3. public static List<Integer> primeFactors(int n)
  分解质因数,返回 n 的质因数。

More: Java Doc

原文地址:https://www.cnblogs.com/huey/p/5606245.html