public static int[] primeList2(int maximum) {
        boolean[] list = new boolean[maximum + 1];
        int primes = 0;
        for (int i = 2; i <= maximum; i++) {
            list[i] = true;
        }
        list[0] = false;
        list[1] = false;
        double wurzel = Math.sqrt(maximum);
        for (int i = 0; i <= maximum; i++) {
            if (list[i] != false) {
                primes++;
                if (i <= wurzel) {
                    for (int j = i * 2; j <= maximum; j += i) {
                        list[j] = false;
                    }
                }
            }
        }
        int[] primelist = new int[primes];
        int c = 0;
        for (int i = 0; i <= maximum; i++) {
            if (list[i]) {
                primelist[c] = i;
                c++;
            }
        }
        return primelist;
    }