An Arithmetic Progression is defined as one in which there is a constant difference between the consecutive terms of a given series of numbers. You are provided with consecutive elements of an Arithmetic Progression. There is however one hitch: exactly one term from the original series is missing from the set of numbers which have been given to you. The rest of the given series is the same as the original AP.  Find the missing term.  

You have to write a function that receives a list, list size will always be at least 3 numbers. The missing term will never be the first or last one.

## Example
```python
find_missing([1, 3, 5, 9, 11]) == 7
```

PS: This is a sample question of the facebook engineer challenge on interviewstreet.
I found it quite fun to solve on paper using math, derive the algo that way.
Have fun!

Difficulty: introductory

Starter code:

def find_missing(sequence):
	

Solutions:
def find_missing(sequence):
    t = sequence
    return (t[0] + t[-1]) * (len(t) + 1) / 2 - sum(t)


def find_missing(sequence):
    interval = (sequence[-1] - sequence[0])/len(sequence)
    for previous, item in enumerate(sequence[1:]):
        if item - sequence[previous] != interval:
            return item - interval


def find_missing(sequence):
    return (sequence[-1] + sequence[0]) * (len(sequence) + 1) / 2 - sum(sequence)


def find_missing(nums):
    a, b, c = nums[:3]
    diff = min(b - a, c - b, key=abs)
    for d in nums:
        if d != a:
            return a
        a += diff


def find_missing(sequence):
    totalGap=sequence[len(sequence)-1]-sequence[0]
    eachGap = totalGap/len(sequence)
    for i in range(len(sequence)-1):
        if sequence[i]+eachGap != sequence[i+1]:
            return sequence[i]+eachGap

def find_missing(s):
       return (len(s)+1)*(s[0]+s[len(s)-1])/2-sum(s)       
    



def find_missing(se):
    step = (se[-1] - se[0])/len(se)
    ls = [se[0] + i*step for i in range(0, len(se)+1)]
    
    return sum(ls) - sum(se)

def find_missing(sequence):
    """Identify the missing element in an arithmetic expression
    following a constant rule
    """
    # A linear list of differences between each element in sequence.
    dif = [sequence[x + 1] - sequence[x] for x in range(len(sequence) - 1)]

    # An array of individual elements and their frequency in dif; [[element, frequency],]
    dif_freq = [[x, dif.count(x)] for x in set(dif)]

    # Sorting by ascending frequency
    sorted_dif_freq = sorted(dif_freq, key=lambda x: x[1])

    outlier = sorted_dif_freq[0][0]
    constant = sorted_dif_freq[-1][0]

    return sequence[dif.index(outlier)] + constant


def find_missing(sequence):
    s = set(sequence)
    m1, m2 = min(s), max(s)
    for i in range(m1, m2 + 1, (m2 - m1) // len(s)):
        if i not in s:
            return i

find_missing=lambda s:(s[0]+s[-1])*(len(s)+1)/2-sum(s)