public int[] rational(int generation, int item) {

        if (generation < 1 || generation > 30)
            return null;
        if (item > 999999999 || item < 0)
            return null;

        int maxItem = (int) (Math.pow(2, generation - 1) + 1);
        if (item >= maxItem) {
            return new int[]{0, 0};
        }

        int[] result = new int[2];

        ArrayList<String> genArray = new ArrayList<>();
        genArray.add("0/1");
        genArray.add("1/0");

        int genIndex = 1;

        while (genIndex < generation) {
            genArray = generate(genArray);
            genIndex++;
        }
        System.out.println("Generation/Item :" + generation + "," + item);
        System.out.println(genArray);
        String genFound = genArray.get(item);
        String[] genA = genFound.split("/");
        result[0] = Integer.parseInt(genA[0]);
        result[1] = Integer.parseInt(genA[1]);
        System.out.println("output : " + result[0] + "," + result[1]);
        return result;
    }