Design an algorithm in Python to find a missing number from a given range of numbers.
[2, 3, 4, 6, 7]
def find_missing_num(arr):
    n = len(arr)
    sum_of_num = (n + 1)*(arr[0] + arr[n-1])/2
    sum_of_arr = sum(arr)
    return sum_of_num - sum_of_arr