Find missing number in arithmetic progression

Algorithm to find missing number in arithmetic progression, Here we are going to use binary search to get missing number in O(logn) time

Input : int a[] = { 1, 2, 3, 4, 6, 7, 8, 9, 10 };
Output : 5