public static void sort2(Integer[] a) {
        int h = 1;
        while (h <= a.length / 3) h = h * 3 + 1;
        System.out.println(h);

        while (h >= 1) {
            for (int i = h; i < a.length; i++)
                for (int j = i; j >= h && less(a[j], a[j - h]); j -= h)
                    change(a, j, j - h);

            h = h / 3;
        }
    }