Find sum of elemets of the array, $AS=\sum_{i=1}^{n}A[i]$. Take $\theta(n)$
Then sum of AP is $S = \frac{n}{2}[2a + (n - 1)d]$ Take $\theta(1)$
$x=S-AS$ will the missing element.
//Find the position of next element (x+d) in array, using binary search
$position=Binary\_Search(A,x+d)-1$ Take $O(\log n)$
$T(n)=\theta(n)+O(\log n)=O(n)$