For what integers $n$ is this divisibility statement true?
The statement being $$n^2 + 2 \mid 2014n + 2$$
The answer is $n = -2, 0, 1, 2014$. Don't know how to arrive at this answer without using comp sci. (Using the compsci answer, we can restrict the domain to integers in the range -2500 to 2500 since we require $n^2 + 2 < 2014n+2$)
It's not hard to see (nor come up with) the ones that do work. Proving that others don't, though..
Solution 1:
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).