@Override
    public Long solve() {

        final int max = 100000000;
        final boolean[] sieve = new boolean[max + 2];
        
        for (int i = 1, q = 1; (q += (i++ << 1) + 1) < sieve.length; ) {
            if (!sieve[i]) {
                for (int j = q; j < max; j += i) sieve[j] = true;
            }
        }

        long sum = 1;
        
        n: for (int n = 2; n <= max; n += 4) {
            for (int d = 1; d * d <= n; ++d) {
               if (n % d == 0 && sieve[d + (n / d)]) continue n;
            }
            sum += n;
        }

        return sum;
    }