public static int sumFactors(int n) {
        int sum = 1, cond = (int) Math.floor(Math.sqrt(n));

        for (int i = 2; i <= cond; i++) {
            if (n % i == 0) {
                sum +=  i;
                if (i != n/i) {
                    sum += n/i;
                }
            }
        }

        return sum;
    }