@Override
    public Long solve() {

        final int max = 1000000 + 1;
        final long[] N = new long[max];
        final boolean[] sieve = new boolean[max];

        long sum = 0;
        
        for (int p = 2; p < max; ++p) {
            if (!sieve[p]) {
                
                long s = p;
                
                for (int i = p; i < max; i += p) {
                    
                    s = findSmallest(p, count(p, i) * 1234567890, s);
                    
                    for (int j = min(max, i + p); j-- > i; ) {
                        if (s > N[j]) N[j] = s;
                    }
                    sieve[i] = true;
                }
            }
        }
        for (int i = 10; i < max; ++i) {
            if ((sum += N[i]) >= 1000000000000000000L) sum -= 1000000000000000000L;
        }
        
        return sum;
    }