If [tex]\vec A[/tex] and [tex]\vec B[/tex] are perpendicular, then their dot product is zero. This means
[tex]\vec A \cdot \vec B = (\vec\imath + 5\,\vec\jmath + n\,\vec k) \cdot (2\,\vec\imath - \vec\jmath + \vec k) = 2 - 5 + n = 0[/tex]
Solving for n is trivial; it follows that n = 3.