find a magic index A[i] = i