@Override
    public Long solve() {

        final int max = 2000;
        final List<Integer> primes = primes(10000);
        
        int count = 2; // 1 and 2
        
        for (long n = 12; ; n += 6) {
            if ((isPrime(n - 1, primes))) {
                if (isPrime(n + 1, primes) && isPrime(2 * n + 5, primes)) {
                    if (++count == max) return (n * (n - 6)) / 12 + 2;
                }
                if (isPrime(2 * n - 7, primes) && isPrime(n + 5, primes)) {
                    if (++count == max) return (n * (n + 6)) / 12 + 2;
                }
            }
        }
    }