public static void main(String[] args) {
        final int max = 1000000;
        final HashMap<Integer, Integer> primes = new HashMap<Integer, Integer>();
        final SieveOfAtkin sieve = new SieveOfAtkin(max);
        final ArrayList<Integer> list = sieve.run();
        for (int prime : list) {
            primes.put(prime, primes.size());
        }

        list.clear();
        final int[] digits = Functions.getDigits(56113);
        final DigitSwapper swapper = new DigitSwapper(2, digits);
        System.out.println(Arrays.toString(digits));
        int[] swapped = null;
        while ((swapped = swapper.next()) != null) {
            if (swapped[0] == 5 && swapped[1] == 6 && swapped[4] == 3) {
//                System.out.println(Arrays.toString(swapped));
                final int number = Functions.getInt(swapped);
                if (primes.containsKey(number)) {
                    list.add(number);
//                    System.out.println("# prime " + number);
                }
//            System.out.println(Arrays.toString(swapped));
            }
        }

        for (int item : list) {
            System.out.println(item);
        }
    }