public static void main(String[] args) {
        int n = 200000;
        int result = 0;
        int iterations = 0;
        int counter = 0;
        boolean[] isPrime = new boolean[n];
        Arrays.fill(isPrime, true);

        for (int i = 2; i * i < n; i++) {
            if (isPrime[i]) {
                for (int j = i * i; j < n; j += i) {
                    iterations++;
                    isPrime[j] = false;
                }
            }
        }

        for (int i = 2; i < n; i++) {
            if (isPrime[i]) {
                iterations++;
                if (counter == 10002) {
                    result = i;
                    break;
                }
                counter++;
            }
        }

        System.out.println("Result: " + result);
        System.out.println("Iterations: " + iterations);
    }