Finding the number of permutations of an integer array with equaling difference (not in order)
You are using a class just to be able to able to mess with some kind of global values. This makes your code very hard to understand. It took me a while to unroll it all and get the following code :

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        run(read());

        run(fake_read());
    }

    static int[] fake_read() {
        int[] a = {1, 4, 2, 5, 7, 6, 9, 8, 3};
        return a;
    }

    static int[] read() {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int [] array = new int [N];
        for (int i = 0; i&lt;N; i++) {
            array[i] = scan.nextInt();
        }
        return array;
    }

    static int [] first_difference(int[] array) {
        int N = array.length;
        int [] temp = new int [N-1];
        for (int i=0; i &lt; N-1; i++) {
            temp[i] = array[i+1] - array[i];
        }
        return temp;
    }

    static void run(int[] array) {
        int [] first_diff = first_difference(array);
        int n = permute(array,0, first_diff);
        System.out.println(Integer.toString(n));
    }

    static public int permute(int[] array, int k, int [] first_diff)
    {
        int result = 0;
        for(int i=k; i&lt;array.length; i++)
        {
            int temp = array[i];
            array[i] = array[k];
            array[k] = temp;
            result += permute(array, k+1, first_diff);
            temp  = array[i];
            array[i] = array[k];
            array[k] = temp;
        }
        if (k == array.length-1)
        {
            result += calculate(array, first_diff);
        }
        return result;
    }

    static int calculate(int [] array, int [] first_diff) {
        int [] diff_values = new int [array.length-1];
        for (int i = 0; i &lt; array.length-1; i++) {
            diff_values[i] = array[i+1] - array[i];
        }
        return compare(diff_values, first_diff);
    }

    static int compare(int [] values, int [] first_diff) {
        int result = 0;
        boolean [] used_new = new boolean [values.length];
        boolean [] used_first = new boolean [values.length];
        for (int i = 0; i &lt; values.length; i++) {
            used_new[i] = false;
            used_first[i] = false;
        }
        for (int i = 0; i &lt; values.length; i++) {
            for (int j = 0; j &lt; values.length; j++) {
                if (!used_new[j] &amp;&amp; first_diff[i] == values[j]) {
                        used_new[j] = true;
                        used_first[i] = true;
                        break;
                }
            }
            if (!used_first[i]) break;
        }
        if (areAllTrue(used_new) &amp;&amp; areAllTrue(used_first)) {
            result += 1;
        }
        return result;
    }

    static public boolean areAllTrue(boolean[] array)
    {
        for(boolean b : array) if(!b) return false;
        return true;
    }
}


I'll be honest with you, I was hoping that once this was done, I'd be facing something somewhat easier to understand but it is not the case (the poor documentation and the function names do not help at all). I guess one could find a simpler (and faster ?) solution but the thing is that I don't even understand what is expected. The question might need clarification.