public static int getPrimeNumber(int number) {
        Sequence<Integer> primes = new ArrayedPrimesSequence();
        int c = 0;
        try {
            while (true) {
                c++;
                int prime = primes.next();
                if (c == number) {
                    return prime;
                }
            }
        } catch (StackOverflowError e) {
            System.out.println("Error after " + c + " iterations.");
        }
        return -1;
    }