Hint $\,\ n^2\!+2\mid 2\!+\!an\,\Rightarrow\,n^2\!+2\mid (2\!+\!an)(2\!-\!an)+a^2(n^2\!+2) \,=\, 4+2a^2\,$
Remark $\ $ Intuitively we took the "norm" of a quadratic number, i.e.
$\qquad\qquad\begin{eqnarray} {\rm mod}\ n^2\!+2\!:\,\ n\equiv \sqrt{-2}\ \ \ {\rm so}\ \ \ 0 &\equiv& \alpha \ =\ \ \, 2 + a\sqrt{-2}\,\equiv\, 2+a\,n \\ \Rightarrow\ \ 0&\equiv& \alpha\bar \alpha = (2+a\sqrt{-2})(2-a\sqrt{-2})\, =\, 4 + 2 a^2\end{eqnarray}$
the norm is one standard way to get a simpler multiple, by mapping "irrational" obects into "rational" objects - as we did above. See here for another example.
Alternatively, we constructed a multiple of $\,n^2\!+2\,$ free of $\,n\,$ by eliminating $\,n\,$ from the multiples $\,2\!+\!an\,$ and $\,n^2\!+2,\,$ by taking a suitable linear combination (mechanized via resultants or Bezout).