I have a quadratic function in $n$, $f(n)$. I want to find out the smallest positive $n$ for which $f(n)$ is composite. Outside of exhaustive search, is there a way to solve this?
Example: $f(n) = n^2 + n + 17$
Preferably, please just provide a hint to point me in the right direction instead of working out the example.