public boolean exists(int input[]){
        
        for(int i=1; i < input.length-1; i++){
            int j = i-1;
            int k = i+1;
            while(j >=0 && k <= input.length-1){
                if(input[i]*2 == input[j] + input[k]){
                    return true;
                }else if(input[i]*2 > input[j] + input[k]){
                    k++;
                }else{
                    j--;
                }
            }
        }
        return false;
    }
http://www.geeksforgeeks.org/length-of-the-longest-arithmatic-progression-in-a-sorted-array/
src/com/interview/number/ArithemeticProgressionExists.java