/**
* 求质因数
* @param n
* @return
*/
public static List<Integer> generatePrimeFactors(int n){
List<Integer> primes = new ArrayList<>();
for(int candidate = 2; n > 1; candidate++){
for(; n % candidate == 0; n/=candidate){
primes.add(candidate);
}
}
return primes;
}