@Override
    public Long solve() {

        final int max = 100000000;
        final int[] s = new int[max + 1];
        
        long sum = 0;
        
        for (int i = 2; i <= max; ++i) {
            if (s[i] == 0) {
                int factorial = i;
                int m_i = i << 1;
                for (long p = i, p_i = i; p <= max; p *= i) {
                    for (; p_i < p; m_i += i) {
                        for (int k = m_i; k % i == 0; k /= i) p_i *= i;
                        factorial += i;
                    }
                    for (int j = (int)p; j <= max; j += p) {
                        if (factorial > s[j]) s[j] = factorial;
                    }
                }
            }
            sum += s[i];
        }
        return sum;
    }