Olympiad Math Question - How many integers $n$ are there such that the result of $n^4-3n^2+9$ is a prime number? Going through some Olympiad past papers again. I came across this question:

How many integers $n$ are there such that the result of $n^4-3n^2+9$ is a prime number?

I saw a related post on this, but factoring a quartic equation does not at all seem plausible in a test where you have to finish the question in a maximum of 5 minutes. In addition, I do not even know where to start in this question.
Here’s the answer I got from the answers sheet:

4

 A: Hint:
Try to factorise the expression. It is reminiscent of the square of a binomial
\begin{align}
n^4-3n^2+9 &= n^4+6n^2+9-9n^2\\
&=(n^2+3)^2-(3n)^2\\
&= ...
\end{align}
Of course, you could write also like $(n^4-6n^2+9)+ 3n^2$ but this leads nowhere.
A: The idea of factoring into two other polynomials with integer coefficients is the right one.
There is a factorization $n^4 - 3 n^2 + 9 = (n^2 - 3 n + 3) (n^2 + 3 n + 3)$.
Once one has this the problem is basically reduced to deciding when either of the two equals $1$ or $-1$ and checking what specifically happens for these $n$ as in the other case as in the linked to post.
Obviously this leaves the question how to find that factorization. The other answer by Aqua gives some advice on that but I would say even a more straight-forward approach works out.
It's a degree four polynomial. Thus if it does not have a linear factor (which is the case as it is always positive) it is the product of two quadratic polynomials with leading coefficient $1$.
So consider:
$(n^2 + a n +b)(n^2 + a'n + b')$
For $n^3$ one gets $a+a'$ which needs to equal $0$.
For $n^2$ one gets $b+b' + aa'$ which needs to equal $-3$.
For $n$ one gets $ab'+a'b$ which needs to equal $0$.
For the constant coefficient one gets $bb'$ which needs to equal $9$.
The first condition gives $a' = -a$. Then plugging this in the third gives $b=b'$ (unless $a = 0$). The final one gives $b=3$ or $b=-3$. Now the second condition is $2b - a^2= -3$, and this works out with $b = 3$ and $a  = 3$.
Now you can check that this actually is a factorization.
Maybe a bit long for five  minutes, but then I think usually for Olympiad style competitions one has a bit more than five minutes per question.
A relevant note there is no need to consider the case $a=0$ and alike. It suffices to find one factorization. The way one finds it can be somewhat non-rigorous. At the end one can check that it is a factorization.
