Searching in sorted array with $O(\log n)$
You can answer the first question with binary search. Lets consider you're now discussing the interval $[l, r]$, and $m = \frac{(l + r)}{2}$. If $A[m] = m$, you have found an answer and you shall stop the search. If $A[m] &lt; m$, then the answer must be in the interval $[m + 1, r]$, because if $i \le m$, then $A[i] \le A[m] - (m - i) &lt; m - (m - i) = i$ (since the array is sorted in strictly ascending order and the elements are integers), thus no $i \in [l, m]$ can be the answer. Otherwise, if $A[m] &gt; m$, then the answer must be in the interval $[l, m - 1]$, because if $i \ge m$, then $A[i] \ge A[m] + (i - m) &gt; m + (i - m) = i$.
And I don't think you can solve the other tasks in $O(lg(n))$ using binary search. Consider these two examples :
$A = [5, 6, 12, 14, 15]$
$B = [4, 9, 12, 14, 17]$
As we know, binary search initially examines the middle element, in these cases, $12$. $12 \ne 3 \times 3 + 2$, thus the search has to continue. In both cases, decision must be the same, since the middle element is the same, therefore, if the algorithm decides to check the interval $[4, 5]$, the algorithm will respond NO to the array $A$, although $5 = 3 \times 1 + 2$, and if the algorithm decides to search the interval $[1, 2]$, it yields NO to the array $B$, while $17 = 3 \times 5 + 2$.
It is also true about the third task, with examples :
$A = [13, 49, 51, 52, 180]$
$B = [12, 48, 51, 52, 193]$
I hope my answer was helpful.