TITLE: Prove that$f(n) = 16n^3+12n^2+3n+1$ is a perfect square if and only if $n = 0$
QUESTION [5 upvotes]: Prove that the polynomial $f(n) = 16n^3+12n^2+3n+1$ from $\mathbb{Z} \to \mathbb{Z}$ is a perfect square if and only if $n = 0$.

I thought about factoring this polynomial but didn't see an easy way of doing that. I also thought about using a modular arithmetic argument, but wasn't sure which modulus to chose. What else can we do?

REPLY [3 votes]: Suppose that $f(n)$ is a perfect square. Note that $4f(n)$ also has to be a perfect square.
Note that :
$$
4f(n) = 64n^3 + 48n^2 + 12n+4 = (4n+1)^3 + 3
$$
Hence, we are essentially solving the problem $y^2 = (4n+1)^3 + 3$. This is similar to a Mordell curve, but since I don't exactly know the specifics, I am just saying that the sequence $A081119$ of the OEIS (Online encyclopaedia of integer sequences) has the number of solutions to $y^2 = x^3+N$ given explicitly.
For $N=3$, the sequence says that the number of solutions is $2$. We can verify that these solutions correspond to $y = 2, x=1$ and $y=-2,x=1$.
Now, it is clear that from $x=1$, $4n+1=1$ so $n=0$ is the only solution giving a perfect square.
Once again, I do not know anything about Mordell curves, but the fact that solutions of $y^2 = x^3 \pm n$ would surely be known for at least small values of $n$ struck me. I still do not understand why the solutions are finite for this equation, though (even for large values of $n$.)