public void Solve() {
        List<Long> primes = Euler.GetLongPrimesList((int) (Math.sqrt(_max) * 1.3));

        double minimumValue = Double.MAX_VALUE;
        long nResult = 0;
        for (int i = 0; i < primes.size(); i++) {
            long firstPrime = primes.get(i);
            for (int j = i + 1; j < primes.size(); j++) {
                long secondPrime = primes.get(j);
                long n = firstPrime * secondPrime;

                if (_max < n) {
                    continue;
                }

                long phiNumerator = (firstPrime - 1) * (secondPrime - 1);
                long phiDenominator = firstPrime * secondPrime;
                long phi = n * phiNumerator / phiDenominator;
                double nPhi = (double) phiDenominator / (double) phiNumerator;

                if (ArePermutations(n, phi) && nPhi < minimumValue) {
                    nResult = n;
                    minimumValue = nPhi;

                    System.out.println("Update for n=" + n + ", phi(n)=" + phi + ", n/phi(n)=" + nPhi);
                }
            }
        }

        System.out.println("Result=" + nResult);
    }