public static ArrayList<Integer> factor(int n, ArrayList<Integer> factors) {
		if (isPrime(n)) {
			factors.add(n);
			return factors;
		}
		
		for (int i = 2; i <= n; i ++) {
			while (n % i == 0) {
				factors.addAll(factor(i));
				n /= i;
			}
		}
		
		return factors;
	}