private static int Phi(int n, boolean[] numbers) {
        for (int i = 0; i < n; i++) {
            numbers[i] = false;
        }
        for (int i = 2; i < n; i++) {
            if (n % i == 0) {
                int j = i;
                while (j < n) {
                    numbers[j] = true;
                    j += i;
                }
            }
        }

        int phi = 1;
        for (int i = 2; i < n; i++) {
            if (!numbers[i]) {
                phi++;
            }
        }
        return phi;
    }